Understanding Typesense's Synonym Functionality
TLDR Blake was having trouble getting partial matches when searching for synonyms in Typesense. Kishore Nallan suggested using an array field for alternative names instead of synonyms.
1
Jan 23, 2023 (9 months ago)
Blake
09:00 AMname
, which is the preferred name. I then create Synonyms using the other names and upsert them to Typesense. When I search using the preferred name it works perfectly, including for partial strings. However, when I search using the Synonym I have to type the complete name for a result to be returned. For example, propolis
has a Synonym bee bread
. Searching "pro" will return propolis
as expected. However, searching for bee
returns no results, similarly bread
also returns no results. Is this how Synonyms are intended to work? My expectation was that a partial search string should return potentially matching synonyms.Kishore Nallan
09:12 AMRegarding synonyms, yes, they don't have typos enabled because typically we have found that to get really confusing and saw various corner cases.
What you could do here is to index these alternative names as an array field and include this field during searching.
Blake
09:13 AMBlake
09:13 AM1
Blake
09:13 AMTypesense
Indexed 2786 threads (79% resolved)
Similar Threads
Resolving Typesense Search Issues
Conversation started by Maximilian about Typesense search behavior led to Users Kishore Nallan and Mike discussing and suggesting workaround, with Kishore Nallan promising an official solution soon. No final confirmation of resolution provided.
Open Source Synonym Collection for Typesense
Matthew asked for an open source synonym collection for Typesense. Jason suggested using semantic search instead.
Resolving Short Word Precedence Issue in Typesense Search
Jake experienced partial short word matches in a typesense search taking precedence over exact matches. Kishore Nallan recommended adjusting the query order, using 'exhaustive_search', and setting 'max_candidates' to optimize results.