This message was deleted.
# community-help
s
This message was deleted.
k
👋 can you post an example query, an example record that you were expecting first, and the record that actually shows up?
p
sure i have the following structure: Documents: {title: 'Eat Croissant in Nice', food: ['Socca', 'Ratatouille'} {title: 'Stroll through Montmartre's cobblestone streets', food: ['Baguette', Croissant] query_by=title,food query_by_weights=2,1 the second one comes first when i search for 'Croissant'
where i want the fields with the most weights to come up first, in my case Eat Croissant in Nice
k
Can you try setting:
Copy code
prioritize_exact_match: false
The exact match with the word
croissant
on the
food
field is giving it a higher text match score. Weight is used to influence the ranking when match score is the same.
p
is there a way to sort the results based on the weight of the fields?
k
There is also the
text_match_type
parameter which can help with the behavior you want. Here's what the docs say:
Copy code
In a multi-field matching context, this parameter determines how the representative text match score of a record is calculated. 

Possible values: `max_score` (default) or `max_weight`. 

In the default `max_score` mode, the best text match score across all fields are used as the representative score of this record. Field weights are used as tie breakers when 2 records share the same text match score.

In the `max_weight` mode, the text match score of the highest weighted field is used as the representative text relevancy score of the record.
So try sending:
Copy code
text_match_type: 'max_weight'
p
nice let me check!
Nope it still doesnt make any difference, the result with food still comes first instead of the result that has the keyword in title
prioritize_exact_match worked though
k
It's max_weight
p
you are right! thank you so much, worked as well
👍 1