I'm executing a query_string query with one term on multiple fields, _all
 and tags.name, and trying to understand the scoring. Query: 
{"query":{"query_string":{"query":"animal","fields":["_all","tags.name"]}}}. 
Here are the documents returned by the query:

   - *Document 1* has an exact match on tags.name, but not on _all.
   - *Document 8* has an exact match on both tags.name and on _all.

Document 8 should win, and it does, but I'm confused by how the scoring 
works out. It seems like Document 1 is getting penalized by having its 
tags.name score multiplied by the IDF twice, whereas Document 8's tags.name 
score 
is only multiplied by the IDF once. In short:

   - They both have a component weight(tags.name:animal in 0) 
   [PerFieldSimilarity].
   - In Document 1, we have weight = score = queryWeight x fieldWeight.
   - In Document 8, we have weight = fieldWeight!

Since queryWeight contains idf, this results in Document 1 getting 
penalized by its idf twice.

Can anyone make sense of this?

I posted this on 
Stackoverflow<http://stackoverflow.com/questions/21213947/why-is-queryweight-included-for-some-result-scores-but-not-others>a
 week ago; the question has some additional information attached to it.

-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/e9bbf46a-b375-45a0-bdd4-3510416bbb03%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to