Can we run bool query in constant_score

can we run bool query in constant_score

sample query

{
  "query": {
    "constant_score": {
      "filter": {
        "bool": {
          "must": [
            {
              "term": {
                "account_id": {
                  "value": "value",
                  "boost": 1.0
                }
              }
            },
            {
              "term": {
                "request_id": {
                  "value": "value",
                  "boost": 1.0
                }
              }
            },
            {
              "term": {
                "ghost_ip": {
                  "value": "value",
                  "boost": 1.0
                }
              }
            }
          ],
          "adjust_pure_negative": true,
          "boost": 1.0
        }
      },
      "boost": 1.0
    }
  }
}


Yes. Why not. But instead I'd use the filter clause instead of must and I'd remove the constant score.

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