I have the exact same issue except that I need to boost a child query based on a value in the parent. Sadly, I went through the same exercise and came to the same conclusions.
I agree that the last query is the correct approach. At first, I assumed that the "has_child" filter was out of scope with the function; however, it recognized the field name without throwing an error. The issue is that it's not returning the field value, so it defaults to 1 and effectively doesn't have any impact on the score. This definitely seems to be a bug. Have you logged it here <https://github.com/elasticsearch/elasticsearch/issues> ? -- View this message in context: http://elasticsearch-users.115913.n3.nabble.com/Impossible-to-implement-real-custom-boost-query-when-the-weight-is-in-the-child-document-tp4057206p4059633.html Sent from the ElasticSearch Users mailing list archive at Nabble.com. -- 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/1405035420852-4059633.post%40n3.nabble.com. For more options, visit https://groups.google.com/d/optout.
