ScrollID is coming as null

I am using elastic8. with java client. I first used elasticclient.search() request
this returned scrollId then i used same scrollID to call
client.scroll(scrollID) api
however the first call elasticclient.search() is returning scollid as NULL.
I have followed this doc

Sorry friends
when i was passing SearchRequestQuery i was not passing scroll unit

                    s -> s.index(index).query(queryobj).scroll(t->t.time("1")), Map.class);

now i am getting the error

[es/search] failed: [illegal_argument_exception] failed to parse setting [scroll] with value [1] as a time value: unit is missing or unrecognized

Now I am not sure what is unit of Scroll value

I am successfully able to get ScrollID but when i set the scrollID on client.scroll(scrollValueFromsearchResponse) i get error


var searchScrollResponse=elasticsearchClient.scroll(x->x.scrollId(scrollId),Map.class);

error i get is as below

failed to parse setting [SearchScrollRequest.keepAlive] with value [FGluY2x1ZGVfY29udGV4dF91dWlkDXF1ZXJ5QW5kRmV0Y2gBFkJISTNWaVowU3ptdnpzclZmVEMxb1EAAAAAAAAAZhZGeEp6VU1MTVRlbXY5OUIyNEZGOXRB] as a time value: unit is missing or unrecognized

keepAlive] with value [FGluaVowU3ptdnpzclZmVEMxb1EAAAAAAAAAZhZGeEp6VU1MTVRlbXY5OUIyNEZGOXRB] as a time value: unit is missing or unrecognized`

how did you manage to not get null for scrollId?

  SearchRequest.Builder searchRequestBuilder = new SearchRequest.Builder();
        searchRequestBuilder.index("myIndex");

        searchRequestBuilder.scroll(new Time.Builder().time("10m").build());
        searchRequestBuilder.size(5);

        return esConnection.search(searchRequestBuilder.build(), clazz);

I'm getting null

do not use scrolling ES 8 dont recommend that use search after.

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