Compute a possible "max_score" for a query

Hi there,

I'm pretty new to the ElasticSearch eco-system and I need the community to help me.

I need to know if the results I get from a full-text search can be considered good or not. I saw the _score depends on the query sent and cannot be used to determine if our results are relevant.
After trying to find a workaround, I got an idea but it does not seem to work and I can't find why.

I try to execute a painless script to calculate the _score of a "fake" document not indexed like that:

{
	"script":
	{
		"source": "_score"
	},
	"context": "score",
	"context_setup":
	{
		"index": _my_index,
		"document":
		{
			"text": "the cat ate the dog"
		},
		"query":
		{
			"more_like_this":
			{
				"fields": ["text"],
				"like": "the cat ate the dog",
				"min_term_freq": 1,
				"min_doc_freq": 1
			}
		}
}
}

What I expect is a maximum "theoretic" score. However I get a score even less big than the indexed documents which are not a perfect match. I thought it was because of the IDF used when processing the query was not the IDF calculated for all my indexed documents but I can't find why ...

Thanks

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