Filtering Issue with Partial Field Information
TLDR 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.
May 01, 2023 (5 months ago)
Facundo
04:35 PMJason,
Thank you for the answer. Is good to know.
I need your technical help one more time:
I'm trying to filter by a field where I want that field not to contain certain info (see first image for the filter_by query I'm doing.
The problem I'm facing, is that in the collection, the real info inside that field is partial (see second image for collection info).
You can see there that the collection has the same info with a ": other" at the end.
How can I achieve this, without using the "q"?
Kishore Nallan
04:39 PMOne work around is to add
:
as a token separator when creating the collection so a string like foo:bar
gets indexed as two separate words foo
and bar
so your filter query can match...e.g.
curl -k "" -X POST -H "Content-Type: application/json" \
-H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}" -d '{
"fields": [
{
"name": "title",
"type": "string"
}
],
"name": "products",
"token_separators": [':']
}'
Facundo
04:43 PMKishore Nallan
04:43 PMFacundo
04:45 PMMay 03, 2023 (4 months ago)
Facundo
05:44 PMFacundo
05:45 PMTypesense
Indexed 2764 threads (79% resolved)
Similar Threads
Querying and Indexing Multiple Elements Issues
Krish queried fields with multiple elements, which Kishore Nallan suggested checking `drop_tokens_threshold`. Krish wished to force OR mode for token, but Kishore Nallan admitted the feature was missing. Krish was able to resolve the issue with url encoding.
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.


Performance Characteristics of Filtering Search Results
Oskar queries the performance difference in filtering search results. Jason clarifies how filters work and provides performance improvement suggestions like increasing vCPUs and sharding the collection. Kishore Nallan explains filter IDs and document ID matching. The thread concludes with discussions on performance tradeoffs in filter implementation.