Syntax changes

Currently we are using Elastic 2.3.x and migrating to 6.8.x and noticed that one of our queries is no longer returning data. The data between the environment versions is 100% the same. We have a job that writes the same to both environments.

The query in question:

{
    "query": {
        "constant_score": {
            "filter": {
                "bool": {
                    "should": [
                        {
                            "term": {
                                "word": "hello"
                            }
                        }
                    ],
                    "must": [
                        {
                            "range": {
                                "year_term": {
                                    "gt": 0
                                }
                            }
                        }
                    ]
                }
            }
        }
    },
    "sort": {
        "year_term": {
            "order": "asc"
        }
    }
}

Would appreciate if someone can easily spot the issue

Could you share a sample document and its mapping?

Basically could you provide a full recreation script as described in About the Elasticsearch category. It will help to better understand what you are doing. Please, try to keep the example as simple as possible.

A full reproduction script is something anyone can copy and paste in Kibana dev console, click on the run button to reproduce your use case. It will help readers to understand, reproduce and if needed fix your problem. It will also most likely help to get a faster answer.

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