Closed pyla96 closed 1 year ago
Hi @pyla96 👋
Since ElasticSearch v7, track_total_hits is false by default. In order to get an accurate total from OpenSearch you need to override the resolver and set track_total_hits to true in the search request.
Nice! that worked well, I couldn't find that information anywhere...
Before opening, please confirm:
JavaScript Framework
React
Amplify APIs
GraphQL API
Amplify Categories
api
Environment information
Describe the bug
When trying to retrieve the total count of items in a table of more than 10,000 items, the "total" field returns the incorrect result of 10,000 items.
Pagination won't work either because using the nextToken returned by the previous query also returns the value of 10,000.
This behavior also occurs for the sum operation.
Expected behavior
Either the total/sum operations return the correct result or pagination returns the rest of the results in the subsequent calls.
Reproduction steps
Code Snippet
Log output
aws-exports.js
No response
Manual configuration
No response
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response