Hi All,
I have a requirement like, need to extract documents based on two fields and out of those two fields i need to exclude one field(optional), and extract data. So for this requirement below is my ES query.
{
"query": {
    "bool": {
        "must": [
            {
                "bool": {
                    "must": [
                        {
                            "term": {
                                "keys": {
                                    "value": "216340000",
                                    "boost": 1
                                }
                            }
                        },
                        {
                            "term": {
                                "code": {
                                    "value": 1067,
                                    "boost": 1
                                }
                            }
                        }
                    ],
                    "adjust_pure_negative": true,
                    "boost": 1
                }
            },
            {
                "bool": {
                    "must_not": [
                        {
                            "term": {
                                "keys": {
                                    "value": "216340000",
                                    "boost": 1
                                }
                            }
                        }
                    ],
                    "adjust_pure_negative": true,
                    "boost": 1
                }
            }
        ],
        "adjust_pure_negative": true,
        "boost": 1
    }
}
}
When I am executing above query, I am getting zero count. But I am suppose to get some count like 20+ count.
Could someone suggest me on my query whether I have written write or I did any mistake in query.
Thanks,
Ram Prasad G