I am trying to implement paging to fetch results in chunk from Terms aggregation result. But it seems Terms aggregation does not support 'From(..)' method.
Below is my Elastic Search Query in NEST -
ISearchResponse<dynamic> bResponse = ObjElasticClient.Search<dynamic>(s => s
.Filter(FQuery)
.Size(10)
.Index(elastic_indexname)
.Source(false)
.AllTypes()
.Aggregations(a => a
.Terms(aggGroupByCDMInvoiceID, t => t
.Field("CDM_INVOICE_ID")
.Size(100)
.Aggregations(innerAgg => innerAgg
.TopHits(aggLatestDocVersion, th => th
.Size(1)
.Source(false)
.Sort(x => x.OnField("VERSION").Descending())
)
)
)
)
);
I have set size 100 for terms aggregation and now implementing paging. But Terms aggregation does not accept 'From(..)' method.
Is there any alternate solution?
Thanks, Sameer