I want to make a simple request with elasticsearch:

(A OR B) AND (C OR D)

I write a request that doesn’t work. Only the C OR D part return results.

{
  "query": {
    "bool": {
      "must": [
        {
          "bool": {
            "minimum_should_match": 1,
            "should": [
              {
                "match": {
                  A
                }
              },
              {
                "match": {
                  B
                }
              }
            ]
          }
        },
        {
          "bool": {
            "minimum_should_match": 1,
            "should": [
              {
                "match": {
                  C
                }
              },
              {
                "match": {
                  D
                }
              }
            ]
          }
        }
      ]
    }
  }
}

Is there an error with my request?

Edit for always sunny.
A AND (B OR C)

{
  "query": {
    "constant_score": {
      "filter": {
        "bool": {
          "should": [
            {
              "match": {
                C
              }
            },
            {
              "match": {
                B
              }
            }

          ],
          "must": {
            "match": {
              A
            }
          }
        }
      }
    }
  }
}

The query return Only B OR C and never A. Did I missed something?

4

Thanks to Always Sunny! It works after I restart elasticsearch

1