# Arranging priority in query

**URL:** <https://discuss.elastic.co/t/arranging-priority-in-query/2368>\
**Category:** Elasticsearch\
**Created:** [June 10, 2015, 6:22pm UTC](https://discuss.elastic.co/t/arranging-priority-in-query/2368 "2015-06-10T18:22:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maarten\_Roosendaal](https://avatars.discourse-cdn.com/v4/letter/m/49beb7/32.png) [@Maarten\_Roosendaal](https://discuss.elastic.co/u/Maarten_Roosendaal)\
**Post date:** [June 10, 2015, 6:22pm UTC](https://discuss.elastic.co/t/arranging-priority-in-query/2368/1 "2015-06-10T18:22:26Z")

</div>

Hi,

We have about 20 fields to search on:

- some fields are more important than others (product\_title and author are more important than synonyms or color)
- some fields can get exact matched (product\_title or author)
- some fields can never match exactly (color, synonyms) on their own but can only add to relevance of the query (looking for 'red vacuumcleaner' is more relevant if producttitle is 'vacuumcleaner' and color is 'red'

How can i compose questions with this kind of priority for fields. I know i can create a termquery with an exact match first on product\_title or author AND a multimatch query on all fields with a boost per field. But how can i make sure that exact matches are always more relevant in such a query withour having the need to make 2 seperate queries.

Thanks,  
Maarten

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [June 10, 2015, 10:06pm UTC](https://discuss.elastic.co/t/arranging-priority-in-query/2368/2 "2015-06-10T22:06:44Z")

</div>

[Boosting](https://www.elastic.co/guide/en/elasticsearch/guide/current/query-time-boosting.html) may help here.

---

<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:** [July 6, 2017, 12:08am UTC](https://discuss.elastic.co/t/arranging-priority-in-query/2368/3 "2017-07-06T00:08:25Z")

</div>


