is it somehow possible to highlight text from a field with values from multiple other fields?
For example:
"Text": "The dog eats an apple under a pine tree."
"animals": ["dog","cat","mouse"]
"fruits": ["orange","apple","banana"]
"trees": "["oak","pine"]
I would like to highlight dog, apple and pine in the Text field but those values come from multiple other fields (animals, fruits and trees in the example). Moreover i do not want to explicitly specify the strings "dog" "apple" and "pine" in any sort of highlight query. It would be great if the Text field is highlighted with any value that is also present in the animals, fruits or trees field.
Why do I need this? I do have documents containing a large text field and multiple other fields containing special terms that i would like to highlight, e.g. with different colors (pre/post tags).
thanks for the reply but this is actually not what i try to achieve. In the article you referenced it is described how to highlight a query in multiple fields. What i would like to do is highlight all the values from multiple field in another field without specifying them in the query at all.
So in the above example if i would query for "eats" i would still like to have the highlights for "dog", "apple" and "pine" from 3 other fields being highlighted in the Text field.
Many thanks for mentioning this, i think it could help to solve this issue. However i do have millions of documents and i would then first need to parse them and add specific annotated markdown additions. And i do not think Logstash or Elasticsearch (via analyzer?) has anything to offer to automatically enrich documents in such a way?
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.