File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -30,18 +30,24 @@ export function instantMeiliSearch(
3030 attributesToSnippet : attributesToCrop ,
3131 attributesToRetrieve,
3232 attributesToHighlight,
33- filters,
33+ filters = '' ,
34+ numericFilters = [ ] ,
3435 } ) {
3536 const limit = this . paginationTotalHits
3637
38+ const filter = [ numericFilters . join ( ' AND ' ) , filters . trim ( ) ]
39+ . filter ( ( x ) => x )
40+ . join ( ' AND ' )
41+ . trim ( )
42+
3743 // Creates search params object compliant with MeiliSearch
3844 return {
3945 q : query ,
4046 ...( facets ?. length && { facetsDistribution : facets } ) ,
4147 ...( facetFilters && { facetFilters } ) ,
4248 ...( attributesToCrop && { attributesToCrop } ) ,
4349 ...( attributesToRetrieve && { attributesToRetrieve } ) ,
44- ...( filters && { filters } ) ,
50+ ...( filter && { filters : filter } ) ,
4551 attributesToHighlight : attributesToHighlight || [ '*' ] ,
4652 limit : ( ! this . placeholderSearch && query === '' ) || ! limit ? 0 : limit ,
4753 }
You can’t perform that action at this time.
0 commit comments