Not sure exactly what you're trying to achieve, but with the elastic proxy API endpoint in Geoportal Server you can use aggregation queries following elastic's syntax. Below is an example:
{
"aggregations": {
"keywords_s_count": {
"terms": {
"field": "keywords_s",
"size": 10
}
}
}
}
POST this query to the elastic proxy api endpoint with your from and size values:
geoportal/elastic/metadata/item/_search?from=0&size=10
will result in something like below
...
"aggregations": {
"keywords_s_count": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 0,
"buckets": [
{ key": "EARTH SCIENCE", "doc_count": 8},
{"key": "RIVERS/STREAMS", "doc_count": 4},
{"key": "SURFACE WATER","doc_count": 2},
{"key": "SURFACE WATER FEATURES","doc_count": 1}
]
}
}
}