Set Size in Elastic Java Client 8.6

Hi! I was trying to connect to Elasticsearch using Java Client 8.6.
I was unable to find this in docs or code - How would I be able to set "size" to limit the result set in Java? Thank You for your help!!

Ho @shravan

You can access the property size in SearchRequest.

client.search(s ->
            s.index("idx")
                .query(query)
                .size(10),
        Your.class);

Thank You :grinning:

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