I'm playing around with `query_by_weights` to try ...
# community-help
n
I'm playing around with
query_by_weights
to try and slightly tune the order of my results when sorted by
_text_match:desc
. I'm finding that
query_by_weights
has a much smaller impact than I expected. My search has 10
query_by
fields and returns 2 results. Document X matches the query only on the 10th field. Document Y matches on the 7th, 8th and 9th fields.
num_typos=0
Fields 7-10 are nested fields, in case that matters.
text_match_info.score
X = 578730123365711921 Y = 578730123365187659 with
query_by_weights=1,1,1,1,1,1,1,1,1,127
X = 578730123365711993 (+72) Y = 578730123365187699 (+40) I expected bigger changes in score, given that I'm weighting field10 127x any other field. What am I not understanding correctly here?
@Jason Bosco following up here
j
@Nathan Shields I suspect it’s related to the
text_match_type
. Could you try setting it to
max_weight
?
In any case, it would be helpful to use actual text… Could you clone this snippet, update it with your data (just a few records) and share it here?
👀 1
n
From what I read in the docs, if I use
max_weight
, the result is purely based on the highest weighted field. I was hoping to still search across all fields -- something like "Field 1 is more important than field 2 OR 3, but if both field 2 AND 3 match the query, that trumps field 1" Regardless, I'll work on that snippet later today
I unfortunately cannot share my schema publicly
j
Are you able to DM me the snippet?
n
Yes, I can do that when I have time 👍