Hey all, just had a quick question about the query...
# community-help
w
Hey all, just had a quick question about the query_by parameter. I know that the params that are listed first are weighted higher in the query_by by default. What is the default weighting for these items? If I have 3 items how is the weight set? For context I'm asking to better understand how to use the query_by_weights parameter.
a
Hey Wahid, When using
query_by_weights
, you must pass a weight for each field listed in
query_by
. The number of weights must match the number of fields exactly. If you don’t pass
query_by_weights
the default is that the first field listed in
query_by
gets the highest implicit weight, and the rest get progressively lower weights. The exact default values are hardcoded, but usually irrelevant in practice: either you’re explicitly setting weights (in which case relative size matters), or you're not setting any and letting the defaults handle it.ust pass an weight for each field declared in query_by.
s
When we use query_by_weights, will the weight that's been set in the query show up in the best_field_weight in text_match_info ? If so, are there any requirements to enable it other than specifying weights in query_by_weights ?