Filter Search Result Strategies
TLDR Sandip asked how to filter string search results. Kishore Nallan recommended using infix and prefix search, but mentioned exact matching as a limitation in filtering.
Aug 18, 2023 (1 month ago)
Sandip
05:07 AMCan I filter search result for string using following scenario:
1. Contains with ""
2. Start with ""
Kishore Nallan
05:10 AMStarts with is supported by prefix search which is enabled by default.
Sandip
05:20 AM{
"accessible_to_user_ids": [
"923e691f-0eb3-412c-b46c-3926dd33a29c",
"b54fef2d-27a4-4926-a3fa-64aba5c4f89b"
],
"ca": "2023-04-19T09:05:18.133336Z",
"comments": [],
"created_at": 0,
"description": "",
"id": "c25c3a95-f126-4bb3-b7a4-17a9e41d9fd8",
"labels": [
"Donna"
],
"labels_id": [
"207ea014-b787-417e-aa15-5cc9a306a79c"
],
"name": "Susan White",
"opening_id": "4ecf3c24-560b-4821-a427-e2df399f3d0b",
"opening_name": "Test data",
"sys_org_id": "0db9d32b-e9b9-4578-9c5c-5fc4260f1fd2",
"ua": "2023-04-19T09:05:18.133336Z",
"updated_at": 0
}
This is my document and below is search query:
{
"q": "su",
"query_by": "name",
"filter_by":"opening_name:ta"
}
Sandip
05:21 AMKishore Nallan
07:44 AMTypesense
Indexed 2779 threads (79% resolved)
Similar Threads
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.
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.
Usage and Modification of Dynamic Routes in Typesense Documents
Ethan needed a way to perform exact queries through two fields in Typesense documents. Kishore Nallan demonstrated its possibility using the "filter_by". An issue was resolved via recommending that fields in 'query by' should be a string type.