Searching inside an array of strings

Searching inside an array of strings, i.e.:

{
"ingredients" : ["grilled cheese", "pork", "ketchup"]
}

query:

{
"match" : {
"cities" : {
"query" : "grilled pork",
"operator" : "and"
}
}
}

Query return the element, because tokens "grilled" and "pork" are both present inside ingredients.
The desidered behaviour is to match the document only if all the words in the query are present inside a single string of the array (not necessarily an exact match, it should match "grilled pork ribs" also, for example).
How can I obtain this?

https://www.elastic.co/guide/en/elasticsearch/guide/current/_multivalue_fields_2.html

This solve my problem, but I cannot figure out how to set "position_increment_gap" mapping using spring data in a java bean.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.