-1

I am getting results that matches my description ABC and XYZ. Now I also want to filter by abc.id should be equal to xyz.id. How i can do that?

{
  "query": {
    "bool": {
      "should": [
        {
          "match_phrase": {
            "description": "abc"
          }
        },
        {
          "match_phrase": {
            "description": "xyz"
          }
        }
      ],
      "minimum_should_match": 1
    }
  }
}```

user3581144
  • 1
  • 1
  • 5

1 Answers1

0

I think what you want to do is to get all doc that match abc and xyc ?

To do so you should replace your should by Must, or use a filter for

 "match_phrase": {
            "description": "xyz"
          }
Jaycreation
  • 2,029
  • 1
  • 15
  • 30