I have a document which looks something like this:
{
content: [
"The first entry is ok",
"But the second entry is great!"
]
}
I can find this document when I search for 'great' under content, but I'd
like to find out that the second element of 'content' is the one that
matched. I can do this by hand, but that's clearly less than ideal.
The only way I've found so far is to abuse the highlighter like this:
"highlight" : {
"pre_tags" : [""],
"post_tags" : [""],
"fields" : {
"content" : {}
}
}
This causes only the entries that matched to show up in highlight.content
in the results. But this seems less than ideal. Is there a better way to do
it?
Thanks,
Russell