# ES 1.7 : Relevant document based on the priority of the field

**URL:** <https://discuss.elastic.co/t/es-1-7-relevant-document-based-on-the-priority-of-the-field/28575>\
**Category:** Elasticsearch\
**Created:** [September 3, 2015, 3:01am UTC](https://discuss.elastic.co/t/es-1-7-relevant-document-based-on-the-priority-of-the-field/28575 "2015-09-03T03:01:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![SAURAV\_PAUL](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/saurav_paul/32/1277_2.png) [@SAURAV\_PAUL](https://discuss.elastic.co/u/SAURAV_PAUL)\
**Post date:** [September 3, 2015, 3:01am UTC](https://discuss.elastic.co/t/es-1-7-relevant-document-based-on-the-priority-of-the-field/28575/1 "2015-09-03T03:01:21Z")

</div>

Hi,

I am confused which option to use. Most relevant output to the user based on the search in each field with minimum match of 30%. I have 4 fields. The match score of each field does matters. It's like the most important field is field-1, on the second most important field is field-3, the third most important field is field-2, the last one is field-4. So do I frame this query into ES query?

---

<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:** [September 3, 2015, 4:08am UTC](https://discuss.elastic.co/t/es-1-7-relevant-document-based-on-the-priority-of-the-field/28575/2 "2015-09-03T04:08:14Z")

</div>

Take a look at the [function score query](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html) perhaps.

---

<div class="post-metadata">

**Author:** ![SAURAV\_PAUL](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/saurav_paul/32/1277_2.png) [@SAURAV\_PAUL](https://discuss.elastic.co/u/SAURAV_PAUL)\
**Post date:** [September 3, 2015, 7:39am UTC](https://discuss.elastic.co/t/es-1-7-relevant-document-based-on-the-priority-of-the-field/28575/3 "2015-09-03T07:39:30Z")

</div>

Thank you. I will go through the function score query. One more thing, how do I search on different fields with different query string like { querystring1 --\> field1 & querystring2--\> field2 & querystring3--\>field3} and the \_score should be the total or avg score of these 3 \_scores? then for more precision & better performance want to use rescoring API

---

<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 5, 2017, 11:52pm UTC](https://discuss.elastic.co/t/es-1-7-relevant-document-based-on-the-priority-of-the-field/28575/4 "2017-07-05T23:52:23Z")

</div>


