Hi, is there additional documentation on the "weig...
# community-help
s
Hi, is there additional documentation on the "weighted_score" field? Where and how do I define it?
k
I don't follow you. Where do you see this
weighted_score
?
Is the weight_score field just part of my schema?
k
Yes that's just a field on your schema
s
Ah okay, got it, thank you
k
What this feature does is to basically not treat text match score as a strict ordering criteria. By "bucketing" the score you mix up the text match score so that similar text matches are deemed the same and are hence ranked only by the custom weight score field's value.
s
Ah okay, then that is not what I am looking for. Could 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:
Copy code
{'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},
for the query "paulschoice C1" with these synonsmys
Copy code
{'id': 'brand-Paulaschoice-synonyms', 'root': '', 'synonyms': ['paulas choice', 'paulas choiceq', 'paulas choice', 'paulas choice', 'paulaschoice']}
I would expect paulas choice to be in the highlighted fields
k
Is the issue around highlighting or the result not even showing up despite having a synonym defined for it?
s
The result shows up, but not on position one (which I would have expected). This is what lands on position 1:
Copy code
{'document': {'brand': '<http://facetheory.com|facetheory.com>',
                        '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},
query:
Copy code
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'
    })
k
On v0.22 or v0.23 RC?
s
0.73
*rc0.23.rc73
k
Ok can you DM me your cluster ID? I will take a look and get back to you.