Here we are throwing all the highlighted keywords into a field called Keywords.
The problem is that the hits items are updated but when you come to get the actual documents. i.e. response.Documents, the documents do not have this update.
Am I correct that if we ask for a highlight of a word/phrase, if there are 20 occurrences, then all 20 is returned?
If so, is there any way to ask Elastic to return just one instance as we only need to know the existence of it as opposed to wanting to highlight every occurrence.
Sorry to bother you again but setting the number_of_fragments produces incorrect results.
Imaging we are sending 3 keywords : keyword1, keyword2 and keyword3.
If there are 50 occurrences of all the keywords, then we should get back just 3items, keyword1, keyword2 and keyword3.
if there are 20 occurrences of keyword1 and one occurrence of keyword2, then we should get back just 2 items keyword1 and keyword2.
If we limit the number of fragments, ES just brings back the first ones it finds without caring which keywords had in fact been matched.
Something like this, but I don't know if thee is a more efficient way of achieving this:
You can use order to exert some influence over the fragment output order, based on score for example (default order is the order in which they are found).
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.