Here is a more detailed version of issue I'm facing...
custom_score query within has_child query does not recognize child document
fields within the score script.
I have two document types, "Forums" and "ForumStats". Forums is a parent
type and ForumStats is a child type. I had set the mapping correctly.
When I issue query like the one below on forums type, ES complains that the
field "avgPostsPerMinute" is not found in "Forums" type, which I feel is
wrong as the script is supposed to look at child document fields.
{
"size": 20,
"sort": {
"_score": "desc"
},
"query": {
"has_child": {
"type": "forumstats",
"score_type": "sum",
"query": {
"custom_score": {
"script": "doc['avgPostsPerMin'].value",
"query": {
"match_all": {}
}
}
}
}
}
}
If I set the script to a value that doe snot refer to child document type,
then the query runs and I get a score for the parent document correctly.
Please review this and let me know if this is by design or a bug. If it is
by design, it looks odd as the custom score query is running on child
documents and I would expect ES to recognize the child document fields
within the script property.
Thanks & Regards,
Aditya.
On Wednesday, July 3, 2013 2:53:36 PM UTC+5:30, aditya.p...@wagglebee.net
wrote:
Can someone please help me with this? It is quite important for one of our
product use cases.
Thanks & Regards,
Aditya.
On Wednesday, July 3, 2013 1:31:53 PM UTC+5:30, aditya.p...@wagglebee.netwrote:
I want to use a custom_score query within has_child query, so that I can
control the score of the child documents. However when I reference a child
document field in has_child custom_score query, ES is trying to map the
field to parent document and is throwing error.
Can anyone please throw some light on this issue and any workarounds?
Thanks & Regards,
Aditya.
--
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 elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.