#random

Phrase Matching vs Prefix Search in Query

TLDR Gerald wanted to prevent phrase matching, and Kishore Nallan suggested wrapping the query in quotes.

Powered by Struct AI
May 29, 2023 (6 months ago)
Gerald
Photo of md5-fc10ba5edfe0e9e7fa8d317508b7569f
Gerald
01:50 AM
then inversely, we could match table lamps, but not table?
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
10:23 AM
query_by does prefix search on keywords by default. So ele will match elephant etc. Also table will match table lamps also because we will pull up all documents that contain the word table.
Gerald
Photo of md5-fc10ba5edfe0e9e7fa8d317508b7569f
Gerald
01:42 PM
Would setting prefix off for that field help the issue?
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
01:46 PM
What is the exact issue? Give me exact query used and the documents that did not match but you expected to.
May 31, 2023 (6 months ago)
Gerald
Photo of md5-fc10ba5edfe0e9e7fa8d317508b7569f
Gerald
02:13 AM
additionalSearchParameters: {      
query_by: "product_cat, pa_material, pa_color, pa_collection, pa_theme, pa_style, post_title", 
sort_by: "_text_match:desc"
},
02:15
Gerald
02:15 AM
Image 1 for
02:16
Gerald
02:16 AM
I think the term is phrase matching?

I would want product_cat to see that “table lamps” does not match “table”
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
02:55 AM
Try with "table lamps" (wrap query in quotes)

Typesense

Lightning-fast, open source search engine for everyone | Knowledge Base powered by Struct.AI

Indexed 3015 threads (79% resolved)

Join Our Community