Elastic Search searchAfter funcitonality not working

Hi I am using the Elasticsearch 8 java client.
I have created one field createdtime which stores epoch timestamp.

Now I first send one request like this

query:{ widcard:{name:foo}.
sort:[creattedtime,asc]

it returns sort searchafter object which I will send for subsequent request.

It just gives up sayinng shard [es/search] failed: [search_phase_execution_exception] all shards failed

    "_source": {
        "includes": ["createtime", "name"]
    },
    "query": {
        "bool": {
            "must": [{
                "wildcard": {
                    "name.keyword": {
                        "value": "*foo*"
                    }
                }
            }, {
                "bool": {
                    "should": [{
                        "match": {
                            "code": {
                                "query": 2
                            }
                        }
                    }, {
                        "match": {
                            "code": {
                                "query": 3
                            }
                        }
                    }]
                }
            }],
            "must_not": [],
            "should": []
        }
    },
    "size": 500,
    "sort": [{
        "createtime": {
            "order": "asc"
        }
    }]
}``` Query generated by elastic8 Java client.

COUNT query count not equal to number of records I got using Searchafter funcitonality

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