# Use of caps in query with field names while perform search

**URL:** <https://discuss.elastic.co/t/use-of-caps-in-query-with-field-names-while-perform-search/291598>\
**Category:** Elasticsearch\
**Created:** [December 13, 2021, 7:37am UTC](https://discuss.elastic.co/t/use-of-caps-in-query-with-field-names-while-perform-search/291598 "2021-12-13T07:37:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![BIRENDRA](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/birendra/32/64625_2.png) [@BIRENDRA](https://discuss.elastic.co/u/BIRENDRA)\
**Post date:** [December 13, 2021, 7:37am UTC](https://discuss.elastic.co/t/use-of-caps-in-query-with-field-names-while-perform-search/291598/1 "2021-12-13T07:37:50Z")

</div>

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,

---

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [December 13, 2021, 8:07am UTC](https://discuss.elastic.co/t/use-of-caps-in-query-with-field-names-while-perform-search/291598/2 "2021-12-13T08:07:45Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![BIRENDRA](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/birendra/32/64625_2.png) [@BIRENDRA](https://discuss.elastic.co/u/BIRENDRA)\
**Post date:** [December 13, 2021, 10:39am UTC](https://discuss.elastic.co/t/use-of-caps-in-query-with-field-names-while-perform-search/291598/3 "2021-12-13T10:39:25Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [January 10, 2022, 10:39am UTC](https://discuss.elastic.co/t/use-of-caps-in-query-with-field-names-while-perform-search/291598/4 "2022-01-10T10:39:38Z")

</div>

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