I am unable to get highlighting results when querying a field of type
attachment in a child document using the has_child query. However I
am able to get the highlighting results if I query directly against
the child document.
Is this supported, or am I doing something wrong?
The child document is of type "contentFiles" with a field called
"file" of type attachment (for pdf file processed by the mapper-
attachments). This query successfully returns highlight elements:
For completeness, here is my mapping for the contentFiles type, but I
think the mapping is ok, since my first query works:
{
"contentFiles": {
"_source" : {
"enabled" : false
},
"_parent": {
"type" : "content"
},
"properties" : {
"file" : {
"type" : "attachment",
"fields" : {
"file" : {"store" : "yes",
"term_vector" : "with_positions_offsets"}
}
}
}
}
}
You can't do highlighting on the content of a child document when using has_child query, that idea for that is to just match and return the parent docs, and those will be the ones that will be highlighted... .
On Wednesday, June 15, 2011 at 11:00 PM, lmader wrote:
I am unable to get highlighting results when querying a field of type
attachment in a child document using the has_child query. However I
am able to get the highlighting results if I query directly against
the child document.
Is this supported, or am I doing something wrong?
The child document is of type "contentFiles" with a field called
"file" of type attachment (for pdf file processed by the mapper-
attachments). This query successfully returns highlight elements:
For completeness, here is my mapping for the contentFiles type, but I
think the mapping is ok, since my first query works:
{
"contentFiles": {
"_source" : {
"enabled" : false
},
"_parent": {
"type" : "content"
},
"properties" : {
"file" : {
"type" : "attachment",
"fields" : {
"file" : {"store" : "yes",
"term_vector" : "with_positions_offsets"}
}
}
}
}
}
Is this a feature that could be supported in the future? We have a
monstrous query that goes against the parent and child docs, and it
would be very convenient if it could do the highlighting in the
has_child part as well.
Good question... . Nothing planned, mainly since implementation wise its quite heavy to do it (if implemented). Need to spend some time thinking about it properly.
On Friday, June 17, 2011 at 2:43 AM, lmader wrote:
Ok, thank you for the info!
Is this a feature that could be supported in the future? We have a
monstrous query that goes against the parent and child docs, and it
would be very convenient if it could do the highlighting in the
has_child part as well.
Hi. Has this been implemented or is there any workaround? As my documents and subdocuments are really big, I'd really like to avoid nested objects/queries.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.