I'm using top_children for finding parent documents by the content of the
child. This works good for me, but I want to be able to search for a field
of the parent too, in the same query. I'm thinking about something like
this:
curl -XPOST 'localhost:9200/default/topic/_search?pretty=true' -d '
{
"query": {
"top_children" : {
"type": "post",
"query": {
"text" : {
"content" : {
"query" : "parent child",
"operator" : "and",
"fuzziness": 0.5
}
}
},
"incremental_factor":5
},
"text": {
"title" : {
"query" : "parent child",
"operator" : "and"
}
}
}'
but it geves me an error:
Parse Failure [No parser for element [title]]
while something like:
curl -XPOST 'localhost:9200/default/topic/_search?pretty=true' -d '
{
"query": {
"text": {
"title" : {
"query" : "parent child",
"operator" : "and"
}
}
}'
works (so without the top children).
Title is a field of topic and content a field of post.
So: how do I combine top children with a search on the parents' own fields?
Thanks in advance.
--