Let's say I have a document with a type as you go field that has multiple values.
tags : ["cool beans", "great job", hello there"]
I do a phrase prefix search with the term "coo". I want to display the user "cool beans" as the match. However, the current query returns all 3 values for the tag field since it matched on the document.
One way would be to use a nested field and through the nested query and inner_hits you would be able to know which element of the array was the match.
If you choose to use an array, you won't be able to get the element because you'll be returning all of them in the document, so you'd have to implement a logic in your application to identify which element of the array was the match.
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.