Discussing Filter Operators in Typesense
TLDR Roshan asked about the functionality of the 'contains' operator in Typesense filters. Kishore Nallan explained how to use the operator and suggested using a curl query for better insight into the issue. However, the thread ends without a resolution.
Feb 17, 2022 (21 months ago)
Roshan
11:13 AMI don't see contains, doesn't contains filter operators there. Does typesense support that?
I also couldn't find all the supported operators in filter by in docs. can you share the link?
Kishore Nallan
11:14 AMKishore Nallan
11:17 AMfilter_by
parameter here: https://typesense.org/docs/0.22.2/api/documents.html#search-parametersRoshan
11:19 AMfilter_by:author_name:=chetan bhagat
above filter by query works for exact match
But for following query
filter_by:author_name:=chet
it doesn't work because the operator (:=) exact match but i want operator contains/like
Kishore Nallan
11:19 AMfilter_by=author_name:chetan
Will work, just don't add the
=
Kishore Nallan
11:20 AM> To match a string field exactly, you can use the
:=
operator. For eg: category:= Shoe
will match documents from the category shoes and not from a category like shoe rack
.Kishore Nallan
11:21 AMRoshan
11:22 AMKishore Nallan
11:22 AMfilter_by=author_name:chetan
will do a contains of the field so "Chetan Bhagat" will match. It's not possible to do fuzzy filtering. For that you need to use the q
parameter.Kishore Nallan
11:22 AMRoshan
11:27 AMilter_by=author_name:chetan
will do a contains of the field so "Chetan Bhagat" will match. no it doesn't work in my caseKishore Nallan
11:32 AMRoshan
11:41 AMin this book search example. can you try filter_by=author_name:Dale and can you check you check in your result whehter books with author name name Dale carnegie appears or not ?
Kishore Nallan
11:41 AMRoshan
11:42 AMRoshan
11:42 AMRoshan
11:42 AMKishore Nallan
11:43 AMRoshan
11:43 AMTypesense
Indexed 2779 threads (79% resolved)
Similar Threads
Implementation and Testing of Negative Filtering on Typesense
Stefan needed an ETA on implementing negative filtering on layer of `typesense`. Kishore Nallan provided updates, fixes, and an early build for testing. Further plans on adding it to instantsearch adapter were discussed, with Stefan also offering to contribute.
Phrase Search Relevancy and Weights Fix
Jan reported an issue with phrase search relevancy using Typesense Instantsearch Adapter. The problem occurred when searching phrases with double quotes. The team identified the issue to be related to weights and implemented a fix, improving the search results.
Docsearch Scrapper Metadata Configuration and Filter Problem
Marcos faced issues with Docsearch scrapper not adding metadata attributes and filtering out documents without content. Jason helped fix the issue by updating the scraper and providing filtering instructions.
Faceting and Filtering Issue in Typesense
Hauke faced issues with facets filtering in Typesense. Kishore Nallan recommended using the instantsearch.js JS library or the multi_search endpoint for independent search queries.
Troubleshooting Typesense Filter_by Parameter Issue
Sagar had trouble with the filter_by parameter in Typesense. Kishore Nallan identified issue related to indexing, which resolved part of the issue. Guidance was given for handling null values.