Top Hits Aggregation Maximum Size?

Is there a maximum size to the number of documents returned by top hits sub aggregation?

[SearchRequest{searchType=QUERY_THEN_FETCH, indices=[container, container], indicesOptions=IndicesOptions[id=38, ignore_unavailable=false, allow_no_indices=true, expand_wildcards_open=true, expand_wildcards_closed=false, allow_aliases_to_multiple_indices=true, forbid_closed_indices=true, ignore_aliases=false], types=, preference='null', requestCache=null, scroll=null, maxConcurrentShardRequests=0, batchedReduceSize=512, preFilterShardSize=128, source={"size":0,"query":{"bool":{"filter":[{"term":{"isDeleted":{"value":false,"boost":1.0}}}],"adjust_pure_negative":true,"boost":1.0}},"aggregations":{"stackingFilter":{"terms":{"field":"stackingFilter","size":100000,"min_doc_count":1,"shard_min_doc_count":0,"show_term_doc_count_error":false,"order":[{"_count":"desc"},{"_key":"asc"}]},"aggregations":{"top":{"top_hits":{"from":0,"size":101,"version":false,"explain":false}}}}}}}]

Because of the "size":101 parameter it throws the following exception:

Suppressed: org.elasticsearch.client.ResponseException: method [GET], host [https://search-analytics-upgrade-bsm7mewvlxsjiw26pxvk43snfu.us-east-1.es.amazonaws.com], URI [/container,container/_search?routing=DSF2&typed_keys=true&ignore_unavailable=false&expand_wildcards=open&allow_no_indices=true&search_type=query_then_fetch&batched_reduce_size=512], status line [HTTP/1.1 400 Bad Request]

When i change the size to <=100 it works fine. This is ES 6.2

Also, would it be more efficient to do terms aggreagion with top hits subaggregation from ES server side, or would it be more efficient to do searchScroll then do the group by on the client side? Assuming around 100k documents per bucket?

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