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)
filter_by? For example, if I have a field
contentwith a value of
hello there, can I filter with
content: hellto return that document?
filter_by... Any reason
query_bywon't work? That does prefix matching like you describe
filter_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 prefixes
Indexed 3015 threads (79% resolved)
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.