Using Partial String Match with Filter_By
TLDR Phillip wanted to use partial string match with filter_by
. Jason suggested using query_by
and explained filter_by's word-level matching works.
Jun 14, 2022 (19 months ago)
Phillip
07:02 PMfilter_by
? For example, if I have a field content
with a value of hello there
, can I filter with content: hell
to return that document?Jason
07:33 PMfilter_by
... Any reason query_by
won't work? That does prefix matching like you describePhillip
07:34 PMPhillip
07:34 PMJason
07:36 PMfilter_by= content:there
(instead of content:=there
) it will do word-level match and return hello there
. But the full word needs to be there in filter_by, it doesn't match on prefixesPhillip
07:36 PMTypesense
Indexed 3015 threads (79% resolved)
Similar Threads
Typesense filters
Dave asked if Typesense's filters could do "contains" instead of whole word matching. Jason suggested using ':' for partial matches instead of ':='. They also mentioned that structured searches can only be done with filter_by.
Trouble with Document Matching in 'filter_by' Field
Roman struggled with incorrect matches in the `filter_by` field. Kishore Nallan explains it only works at the word level, not partial prefix, and suggested setting `drop_tokens_threshold` to 0 to prevent incorrect matches.
Filtering Issue with Partial Field Information
Facundo faced an issue filtering by a field with partial information. Kishore Nallan suggested adding ':' as a token separator and using "q" for prefix search.