I have the next problem, my data structure has this shape:
{"editions":['optionA', 'optionB']}
I need to exclude ALL results with this shape:
{"editions":['optionB']}
But include ALL results with this shape:
{"editions":['optionA']}
or
{"editions":['optionA', 'optionB']}
Being more clear, I need to exclude all results that just have one entry in editions and his value is optionB
specifically.
I've been trying something like:
bool: {
must: [
{
query_string: {
default_field: "name",
query: `${params.text}*`
},
}
],
must_not : {
term : { "editions" : "optionB" },
must : {
script : {
script : {
inline: "doc['editions'].values.length < 2",
lang: "painless"
}
}
}
}
}
But no results are given. Thanks in advance!
PD: I'm using ElasticSearch 7.*