Querying String Arrays with Prefix=false and Typesense
TLDR Roman needed assistance with querying string arrays using prefix=false in Typesense. Kishore Nallan clarified how searching array elements works and advised using a plain string.
Feb 21, 2023 (10 months ago)
query_byhas a single
• no additional params except
prefix=falseare set, we want to find documents that have both “react” (or its synonym) and “python” (or its synonyms) in
stringfield that is being queried, we don’t need prefixed search for any of these terms
• there are synonyms defined for “react”: “reactjs,REACT.JS,reactJS,React js,React,React.JS,react js,react,react-jsx,react.js,Reactjs,React.Js,React.js,ReactJS,React JS”
• no synonyms for word “python” are set
q, we’d expect Typesense to find the same amount of records for both “react python” and “python react”.
prefix=falsemakes result somewhat the same, but I think we want to keep it because we don’t want
Kishore Nallan08:10 AM
react pythonwill NOT match against a field value of
["react", "python"]because they are considered as separate elements.
Kishore Nallan08:12 AM
Feb 22, 2023 (10 months ago)
> we still expect both tokens in the query to appear within a single array element
I don’t think so? I mean the screenshots above show how Typesense successfully queries against a string array field, it’s just the amount of results changes depending on whether “react python” or “python react” is set to
Is there a way to tell Typesense that the order of words doesn’t matter? And keep
Kishore Nallan04:22 PM
tags: stringcontaining all words present in
q(or their synonyms)?
Feb 24, 2023 (9 months ago)
Kishore Nallan12:08 PM
foo barwill NOT match
Kishore Nallan12:08 PM
Indexed 3011 threads (79% resolved)
Typesense Search Query
Mischa was having issues with a Typesense search query and Jason suggested setting the prefix parameter to false.
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.
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.
Solving Typesense Cloud Interface Issue in Python
Orion had an issue querying from Python in the Typesense Cloud interface. Kishore Nallan identified the problem within the array declaration. They then discussed improving error messages and Orion offered to make a PR.