I'm using ngrams to do partial matching. I would like to retrieve fragments
of the documents that match the partial text, with highlighting.
I have the highlight option in the query, but it works only for full text
searches; for partial searches, the highlight entry is empty.
I can always add the field to the "fields" section and get the results that
way; but I would prefer to just get snippets (fragments)
instead of the entire document. Any ideas?
Found it. One must use the alias for the partial match in the highlight
section. Works like a charm!
On Wednesday, December 5, 2012 1:28:40 AM UTC-8, A Zed wrote:
I'm using ngrams to do partial matching. I would like to retrieve
fragments of the documents that match the partial text, with highlighting.
I have the highlight option in the query, but it works only for full text
searches; for partial searches, the highlight entry is empty.
I can always add the field to the "fields" section and get the results
that way; but I would prefer to just get snippets (fragments)
instead of the entire document. Any ideas?
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.