elasticsearch - NEST API - Implement Pagination for Terms aggregation -


i trying implement paging fetch results in chunk terms aggregation result. seems terms aggregation not support 'from(..)' method.

below 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 =>                                                  .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 terms aggregation , implementing paging. terms aggregation not accept 'from(..)' method.

is there alternate solution?

thanks, sameer

maybe order terms differently , page filtering on index?

as per documentation:

change ordering:

{     "aggs" : {         "genders" : {             "terms" : {                 "field" : "gender",                 "order" : { "_term" : "asc" }             }         }     } } 

and filter:

{     "aggs" : {         "tags" : {             "terms" : {                 "field" : "tags",                 "include" : ".*sport.*",                 "exclude" : "water_.*"             }         }     } } 

alternatively reverse order , use min_doc_count doc count previous result paging:

{     "aggs" : {         "tags" : {             "terms" : {                 "field" : "tags",                 "min_doc_count": 10             }         }     } } 

Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -