# If else query on elastic search

**URL:** <https://discuss.elastic.co/t/if-else-query-on-elastic-search/302663>\
**Category:** Elasticsearch\
**Tags:** kql-kibana-query-language\
**Created:** [April 19, 2022, 4:48am UTC](https://discuss.elastic.co/t/if-else-query-on-elastic-search/302663 "2022-04-19T04:48:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anime\_lover](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anime_lover/32/100265_2.png) [@anime\_lover](https://discuss.elastic.co/u/anime_lover)\
**Post date:** [April 19, 2022, 4:48am UTC](https://discuss.elastic.co/t/if-else-query-on-elastic-search/302663/1 "2022-04-19T04:48:08Z")

</div>

Hi there ,  
i am facing some problem on searching .  
My problem is : Suppose i have three field A,B and C . If i search for certain text then it should search on field A first if found ,stop searching and return result if not search on next field and so on.  
If it is not possible ,why?  
if it is not possible for multiple shard than is it possible for single shard?

Please help me in this ..  
Thanks.

---

<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:** [May 17, 2022, 4:48am UTC](https://discuss.elastic.co/t/if-else-query-on-elastic-search/302663/2 "2022-05-17T04:48:34Z")

</div>

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