Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How can I understand with which query the documents returned as a result of the should query in elasticsearch are returned?

I have a query like below. Here my minimum_should_match value is 1. Many documents with "text" value "car" or "year" value "2019" can return. Here, I want to find out by which query the documents returned as a result of this query are returned. How can I do this in elasticsearch?

GET my_index/_search
{
  "query": {
    "bool": {
      "should": [
        {
          "term": {
            "text": {
              "value": "car"
            }
          }
        },
        {
          "term": {
            "rank": {
              "value": "2"
            }
          }
        },
        {
          "term": {
            "year": {
              "value": "2019"
            }
          }
        }
      ],
      "minimum_should_match": 1
    }
  }
}

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Named queries might work for you – https://www.elastic.co/guide/en/elasticsearch/reference/7.17//query-dsl-bool-query.html#named-queries

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading