Illegal_argument_exception when searching with scroll in new elasticserach java client

What is the correct syntax when building a search request with scroll.

I did this but I get an exception

    final co.elastic.clients.elasticsearch.core.SearchRequest req =
        rbuilder
            .index(indexPref)
            .scroll(t -> t.time("60000"))
            .build();

I got the following error:

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

Unit should be milliseconds, but I dont where to put it.

Hi @ALX_DM

You should follow the Time Unit convention.

In your code replace "60000" with "60000s", if the scale is in seconds.

1 Like

@RabBit_BR

Thank you!

Much appreciated! :beers:

1 Like

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