File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -506,17 +506,16 @@ impl<'a> FilterParams<'a> {
506
506
// OR (exact_match = exact_match' AND rank < rank')
507
507
// OR exact_match < exact_match'`
508
508
let q_string = self . q_string . expect ( "q_string should not be None" ) ;
509
- let q = to_tsquery_with_search_config (
510
- configuration:: TsConfigurationByName ( "english" ) ,
511
- q_string,
512
- ) ;
509
+ let q = sql :: < TsQuery > ( "plainto_tsquery('english', " )
510
+ . bind :: < Text , _ > ( q_string)
511
+ . sql ( ")" ) ;
513
512
let rank = ts_rank_cd ( crates:: textsearchable_index_col, q) ;
514
513
let name_exact_match = Crate :: with_name ( q_string) ;
515
514
vec ! [
516
515
Box :: new(
517
516
name_exact_match
518
517
. eq( exact)
519
- . and( rank. eq( rank_in) )
518
+ . and( rank. clone ( ) . eq( rank_in) )
520
519
. and( crates:: name. nullable( ) . gt( crate_name_by_id( id) ) )
521
520
. nullable( ) ,
522
521
) ,
Original file line number Diff line number Diff line change @@ -429,7 +429,8 @@ fn index_sorting() {
429
429
}
430
430
431
431
// Sort by relevance
432
- for query in [ "q=foo_sort" , "q=sort" ] {
432
+ // Add query containing a space to ensure tsquery works
433
+ for query in [ "q=foo_sort" , "q=sort" , "q=foo%20sort" ] {
433
434
let ( resp, calls) = page_with_seek ( & anon, query) ;
434
435
assert_eq ! ( calls, resp[ 0 ] . meta. total + 1 ) ;
435
436
let decoded_seeks = resp
You can’t perform that action at this time.
0 commit comments