# Feedback loop for results from elastic search

**URL:** <https://discuss.elastic.co/t/feedback-loop-for-results-from-elastic-search/76913>\
**Category:** Elasticsearch\
**Created:** [March 1, 2017, 4:59am UTC](https://discuss.elastic.co/t/feedback-loop-for-results-from-elastic-search/76913 "2017-03-01T04:59:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![vishva\_deepak\_tewari](https://avatars.discourse-cdn.com/v4/letter/v/f07891/32.png) [@vishva\_deepak\_tewari](https://discuss.elastic.co/u/vishva_deepak_tewari)\
**Post date:** [March 1, 2017, 4:59am UTC](https://discuss.elastic.co/t/feedback-loop-for-results-from-elastic-search/76913/1 "2017-03-01T04:59:09Z")

</div>

I have a scenario where I need to list a bunch of jobs from elastic search. The searches would mainly be done by keywords eg. (electrical engineering, driver etc.) I want to create a feedback system where corresponding keyword is given higher weightage if the user clicks on a particular job.

So far it is all doable. I am facing problem because in my system user can search with multiple keywords eg. (driver or electrical engineering). Query that would be constructed for this would be as follows

_{_  
_"query" : {_  
_"bool": {_  
_"should": [_  
_{_  
_"multimatch": {_  
_"query" : "electrical engineering",_  
_"fields" : [_  
_"description^1.0",_  
_"name^1.0"_  
_]_  
_}_  
_},_  
_{_  
_"multimatch": {_  
_"query" : "driver",_  
_"fields" : [_  
_"description^1.0",_  
_"name^1.0"_  
_]_  
\_} \_  
_}_  
_]_  
_}_  
_},_  
_"sort" : [_  
_{_  
_"score" : {_  
_"order" : "desc"_  
_}_  
_}_  
_]_  
_}_

Now in this scenario, is there a way, I can associate a result with a particular multi match clause, so that i can identify that this result is here because of word driver and this is here because of electrical engineering, so that i can complete feedback loop

If anyone has any better idea so that i can complete my feedback loop, please feel free share it.

Thanks

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 1, 2017, 6:01am UTC](https://discuss.elastic.co/t/feedback-loop-for-results-from-elastic-search/76913/2 "2017-03-01T06:01:33Z")

</div>

This might be helpful

[https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-named-queries-and-filters.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-named-queries-and-filters.html)

---

<div class="post-metadata">

**Author:** ![vishva\_deepak\_tewari](https://avatars.discourse-cdn.com/v4/letter/v/f07891/32.png) [@vishva\_deepak\_tewari](https://discuss.elastic.co/u/vishva_deepak_tewari)\
**Post date:** [March 1, 2017, 7:12am UTC](https://discuss.elastic.co/t/feedback-loop-for-results-from-elastic-search/76913/3 "2017-03-01T07:12:59Z")

</div>

Hi,  
Thanks for the suggestion. This would resolve the problem.  
However let's say the description for electrical engineering job has a text like **Candidate needs to be comfortable with drivers used in microchips.**. The above named query would return that this result is satisfied by driver query as well.

The documentation for named queries does not gives any method to know the relevant score for each named query or an ability to find the maximum matched query. If I can have something on that front, I will be able to increase weightage for a higher matched query.

Thanks

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 1, 2017, 7:45am UTC](https://discuss.elastic.co/t/feedback-loop-for-results-from-elastic-search/76913/4 "2017-03-01T07:45:51Z")

</div>

May be using explain (but not recommended for production).

Not sure if this could help either but pasting it in case it gives you some ideas: [https://www.elastic.co/guide/en/elasticsearch/reference/5.2/docs-termvectors.html](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/docs-termvectors.html)

---

<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:** [March 29, 2017, 7:45am UTC](https://discuss.elastic.co/t/feedback-loop-for-results-from-elastic-search/76913/5 "2017-03-29T07:45:52Z")

</div>

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