I have an indexed job description field. I am trying to rank or order the results by number of matches.
Example, I am searching for:
- friendly
- honest personality
- excellent communication skills
Records with most number of matches will be ranked highest. I tried the suggested here https://stackoverflow.com/a/45319822/2445717 but did not work as what I expected.
Below is my current query:
{
"query": {
"bool": {
"must": [
{
"bool": {
"should": [
{
"match": {
"job_description": {
"query": "friendly",
"operator": "and"
}
}
},
{
"match": {
"job_description": {
"query": "honest personality",
"operator": "and"
}
}
},
{
"match": {
"job_description": {
"query": "excellent communication skills",
"operator": "and"
}
}
}
]
}
}
]
}
}
}