Feedback loop for results from elastic search

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

This might be helpful

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

1 Like

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

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

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