Query on "weighted_score" & Issue with Synonym Highlighting
TLDR Stefan asked about "weighted_score" field and reported a possible synonym highlighting issue. Kishore Nallan clarified the use of "weighted_score". The possible synonym issue is still being investigated.
Jun 03, 2022 (19 months ago)
Stefan
12:08 PMKishore Nallan
12:09 PMweighted_score
?Stefan
12:10 PMKishore Nallan
12:11 PMStefan
12:11 PMKishore Nallan
12:12 PMStefan
12:15 PMCould it be that there is a "bug" when you define a synonym that a match through a synonym is not taking into account fully?
For example this result:
{'document': {'brand': "Paula's Choice",
'key_ingredients_flat': ['ASCORBIC ACID',
'ACETYL OCTAPEPTIDE-3', 'FERULIC ACID', 'PANTHENOL', 'GLYCERIN', 'SODIUM HYALURONATE', 'TOCOPHEROL'],
'name': 'Resist C15 Super Booster'},
'highlights': [{'field': 'name',
'matched_tokens': ['C1'],
'snippet': 'Resist <mark>C1</mark>5 Super Booster'}],
'text_match': 282583051272194},
Stefan
12:15 PMwith these synonsmys
{'id': 'brand-Paulaschoice-synonyms', 'root': '', 'synonyms': ['paulas choice', 'paulas choiceq', 'paulas choice', 'paulas choice', 'paulaschoice']}
Stefan
12:16 PMKishore Nallan
12:17 PMStefan
12:18 PM{'document': {'brand': '',
'key_ingredients_flat': ['SALICYLIC ACID',
'LACTIC ACID',
'SODIUM ASCORBYL PHOSPHATE',
'GLYCERYL STEARATE SE',
'CETYL ALCOHOL',
'PRUNUS AMYGDALUS DULCIS OIL',
'PRUNUS ARMENIACA KERNEL OIL',
'PERSEA GRATISSIMA OIL',
'COCOS NUCIFERA OIL',
'GLYCERIN'],
'name': 'VITAMIN C CLEANSER C1'},
'highlights': [{'field': 'name',
'matched_tokens': ['C1'],
'snippet': 'VITAMIN C CLEANSER <mark>C1</mark>'}],
'text_match': 282583068049410},
Stefan
12:18 PM results = client.collections[PUBLIC_SCHEMA_NAME].documents.search({
'q': "paulaschoice c1",
'query_by': 'name,brand,key_ingredients_flat',
"include_fields": 'name,brand,key_ingredients_flat',
"prioritize_exact_match": False,
"query_by_weights": '2,2,0'
})
Kishore Nallan
12:18 PMStefan
12:19 PMStefan
12:19 PMKishore Nallan
12:19 PMTypesense
Indexed 3015 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.
Docusaurus Integration - Search Results Ordering & Missing Highlight
Abhishek reported issues with search result ordering and missing highlights in docusaurus integration. Jason explained the result differences between modal and search page. Abhishek submitted a fix for the highlight issue.
Issue with Embedding Error in Version 0.25.0.rc63
Bill reported a bug in version 0.25.0.rc63 regarding a problem with updating or emplacing a document and receiving an embedding error. This was resolved in version 0.25.0.rc65, but further discussion ensued regarding the function of 'index' in the update feature.
Troubleshooting Typo Highlighting in Search Queries
Stefan queried "chews" and "Roche", despite having a typo distance of 4, was highlighted. Kishore Nallan requested to test on v0.20 RC. Random results like "Sachets" and "Lachesca" were also highlighted. On single record query, highlighting works. Kishore Nallan assured to address this issue in the pending release.
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.