Use of caps in query with field names while perform search

Hi Team,

I have seen caps in field names while doing a search. Specially inside should block which contributes to score. I tried doing similar thing to see the effect but score remained same whatever number I gave after ^. Below is the sample query:

{
"query": {
"function_score": {
"score_mode": "sum",
"boost_mode": "sum",
"boost": 1,
"query": {
"bool": {
"should": [
{
"constant_score": {
"filter": {
"multi_match": {
"fields": [
"firstName.analyzed^2"
],
"query": "*John"
}
},
"boost": 1.2
}
},
{
"constant_score": {
"filter": {
"multi_match": {
"fields": [
"lastName.analyzed^8"
],
"query": "*Cena"
}
},
"boost": 1.4
}
}
]
}
}
}
}
}

Here, firstName and lastName has ^with value of 2 and 8. Using explain api I checked document score with different values but it remained same.

So my query is why do we use ^ operator in search queries ? Does it have any impact on the result sets returned in terms of number or order.

Any hint or idea may help me in understanding this.

Thanks,

From a quick glance it is the use of the “constant_score” wrapper that is making your boosts redundant.

1 Like

I guess I am not clear with the use of constant_score within functional score. Let me try some more things to exactly discuss the issue with you.

Thanks anyways for giving some hint.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.