Scoring with query string query on multiple inner object fields

Hi,

I'm trying to understand why my query ranking doesn't work the way I expect it.

My query is something like this:

"query_string": {
"query": "developer",
"fields": [
"preferredJobs.raw",
"experiences.jobTitle",
"experiences.companyName",
"experiences.description",
]
}

I would expect that for each field the score would be calculated (so 4 scores) and that these scores would be summed to calculate the total score of the document (I use no boosting or whatsoever).
Instead, the total score of the document is the score of the field with the highest score.
I tried the same with a multi match query with the most_fields type, but this still doesn't give the correct results.

What am I doing wrong?

Thanks,

Marten

Although I still don't understand why it didn't work, I've solved it.
I changed the single must query in multiple should queries and that worked.

Maren

If you dont understand the ranking a good candidate to debug is the explain API as well as setting explain: true in a search request (note both require additional resources, so only do those manually).

Hi Alexander,

Thanks for your response.
I tried that already, that's why I found out that the query used the best score instead of summing them all up.
Anyway, I've got it covered now.

Thanks,

Marten

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