manticoresoftware / manticoresoftware/manticoresearch-java

The default addition of "aggs": {} causes scroll pagination invalid

Open
#23 1 comment 0 reactions 1 assignee View on GitHub

@Nick-S-2018 is already working on this.

Since Aug 25, 2025.

Dominant language
Java
Stars
65
Forks
5
PR merge metrics
No merged PRs in 30d

Description

sdk version: 8.1.0
```java
/**
* search
*/
public SearchResponse search(String tableName, String queryString, List sort, String scrollToken,
Integer size) {
ApiClient client = this.newClient();

SearchQuery searchQuery = new SearchQuery();
searchQuery.setQueryString(queryString);

SearchRequest searchRequest = new SearchRequest();
searchRequest.table(tableName).query(searchQuery);
searchRequest.sort(sort);
searchRequest.limit(size);

// scroll pagination
Map options = new HashMap<>();
if (StrUtil.isNotBlank(scrollToken)) {
options.put("scroll", scrollToken);
} else {
options.put("scroll", true);
}
searchRequest.options(options);

SearchApi searchApi = new SearchApi(client);

try {
SearchResponse response = searchApi.search(searchRequest);
log.debug("Search response: {}", response);
return response;
} catch (ApiException e) {
this.printError(e);
throw new RuntimeException(e);
}
}
```

final json body:
```json
{
"table": "products",
"query": {
"query_string": "黑色"
},
"join": [],
"limit": 10,
"aggs": {},
"expressions": {},
"options": {
"scroll": "eyJvcmRlcl9ieV9zdHIiOiJzYWxlcyBhc2MsIGlkIGFzYyIsIm9yZGVyX2J5IjpbeyJhdHRyIjoic2FsZXMiLCJkZXNjIjpmYWxzZSwidmFsdWUiOjAsInR5cGUiOiJpbnQifSx7ImF0dHIiOiJpZCIsImRlc2MiOmZhbHNlLCJ2YWx1ZSI6MjMwOTE4NDQwMzM3NDM0MjE1MywidHlwZSI6ImludCJ9XX0="
},
"sort": [
{
"sales": {
"order": "asc"
}
},
{
"id": {
"order": "asc"
}
}
]
}
```

There is an `"aggs": {}`, is auto-generated, it will cause scroll pagination invalid.
Did I use it incorrectly, or is this a feature or a bug ?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.