I have a list, an array, or whatever language you are familiar with. For example. names: ["John","Bas","Peter"] , and I want to query the name field if it matches one of these names.
One way is by using an OR filter. eg.
{ "filtered" : { "query" : { "match_all": {} }, "filter" : { "or" : [ { "term" : { "name" : "John" } }, { "term" : { "name" : "Bas" } }, { "term" : { "name" : "Peter" } } ] } } }
Love way? Better if it's a query than a filter.
elasticsearch
Diolor
source share