I need to solve a problem with SHOULD conditions which makes groups and this groups should be separately evaluated according minimum should match. So no only one group with should condition but more separated groups of should conditions.
Imagine conditions like A1, A2, A3 and B1 B2 B3. Simple should query looks like:
{
"query": {
"bool": {
"should": [
{ A1 },
{ A2 },
{ A3 },
{ B1 },
{ B2 },
{ B3 },
],
"minimum_should_match" : 1
}
}
}
BUT I need to evaluate minimum_should_match on every groups. One for A group and second for B group. Something like (this is an idea not a valid code):
{
"query": {
"bool": {
"should": [
{ A1 },
{ A2 },
{ A3 },
],
"minimum_should_match" : 1,
"should": [
{ B1 },
{ B2 },
{ B3 },
],
"minimum_should_match" : 1
}
}
}
As you can see I need bool result for each of should groups to be TRUE. Is it possible to do it in ElasticSearch 6? Thanks.