Query having firsts five elements in the array

Hi,

Do you know any query that can be used to get first five elements in the array of the document if the array has more than 20 elements.

Basically 5 is a parameter and it can vary. please advice on this.

ex: itemID,itemlist : [ 1,2,3,4,5,6,7,8,9,10,11,12,13,14]

expected:
itemID, itemlist:[1,2,3,4,5]

Elasticsearch does not really modify the _source document. So my guess is that it would be easier to solve that on the client side.

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