Weighting search parameters: `store_name` vs `tags`
TLDR Shadab needed help with search parameters. Kishore Nallan suggested prioritize_exact_match: false
which partially solved the issue. Reading docs helped Shadab find text_match_type: "max_weight"
, solving the problem.
Oct 30, 2023 (1 month ago)
Shadab
07:27 AMI have a query like this
search_parameters = {
'q': 'work',
'query_by': 'store_name, tags', //store_name = string "" & tags = String []
'num_typos': 2,
'typo_tokens_threshold': 1,
}
Suppose I have fields like this on my doc:-
1.
store_name
like Work Anniversary, Work Culture.2.
tags
on some stores as โworkโI want to show the
store_name
to take the priority instead of the exact match (tags) in this case.PS: I have tried query_by_weights but itโs not working how I want
Kishore Nallan
08:23 AMprioritize_exact_match: false
Shadab
08:30 AMBut another case ๐ฌ
1. If I have another Store named as WorkShop then for this case still
tags
exact match is taking priority.Is there anyway I can directly add that only when all
store_name's
are done (whether Work or WorkShop) then process for the tags
?Shadab
08:46 AMtext_match_type: "max_weight"
What I needed is achieved now, thanks.
Kishore Nallan
09:02 AMTypesense
Indexed 3015 threads (79% resolved)
Similar Threads
Query Weighting Issue with 'Prioritize_Exact_Match'
John is facing issues with search results prioritizing lower query weights. Kishore Nallan explained it as a limitation in text match scoring, but agreed on the need for better scoring configuration.
Sorting Search Results Based on Weights
Pantelis wanted to sort search results by weight. Kishore Nallan suggested using "prioritize_exact_match: false" and "text_match_type: 'max_weight'" to achieve the desired result.
Typesense Query and Matching Explained.
David queried about Typesense's query weights and matching. Jason clarified that Typesense prioritizes exact matches in the same field, which can be changed with 'prioritize_exact_matches: false'.