Add from and size parameters to terms lookup query for pagination support#20923
Add from and size parameters to terms lookup query for pagination support#20923ShawnQiang1 wants to merge 1 commit intoopensearch-project:mainfrom
Conversation
PR Code Analyzer ❗AI-powered 'Code-Diff-Analyzer' found issues on commit 28f7402.
The table above displays the top 10 most important findings. Pull Requests Author(s): Please update your Pull Request according to the report above. Repository Maintainer(s): You can Thanks. |
PR Code Analyzer ❗AI-powered 'Code-Diff-Analyzer' found issues on commit b0d26ff.
The table above displays the top 10 most important findings. Pull Requests Author(s): Please update your Pull Request according to the report above. Repository Maintainer(s): You can Thanks. |
PR Code Analyzer ❗AI-powered 'Code-Diff-Analyzer' found issues on commit fbb8356.
The table above displays the top 10 most important findings. Pull Requests Author(s): Please update your Pull Request according to the report above. Repository Maintainer(s): You can Thanks. |
PR Code Analyzer ❗AI-powered 'Code-Diff-Analyzer' found issues on commit 4ec8da0.
The table above displays the top 10 most important findings. Pull Requests Author(s): Please update your Pull Request according to the report above. Repository Maintainer(s): You can Thanks. |
PR Code Analyzer ❗AI-powered 'Code-Diff-Analyzer' found issues on commit 2c89aad.
The table above displays the top 10 most important findings. Pull Requests Author(s): Please update your Pull Request according to the report above. Repository Maintainer(s): You can Thanks. |
PR Code Analyzer ❗AI-powered 'Code-Diff-Analyzer' found issues on commit 1721ab5.
The table above displays the top 10 most important findings. Pull Requests Author(s): Please update your Pull Request according to the report above. Repository Maintainer(s): You can Thanks. |
PR Reviewer Guide 🔍(Review updated until commit 957d58f)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to 957d58f
Previous suggestionsSuggestions up to commit a18cd94
|
|
❌ Gradle check result for a18cd94: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Adds pagination support for terms lookup queries via new from and size parameters in TermsLookup. Allows users to control which terms are fetched from the lookup index. Signed-off-by: Shawn Qiang <814238703@qq.com> Co-authored-by: OpenCode <support@opencode.ai>
PR Code Analyzer ❗AI-powered 'Code-Diff-Analyzer' found issues on commit 957d58f.
The table above displays the top 10 most important findings. Pull Requests Author(s): Please update your Pull Request according to the report above. Repository Maintainer(s): You can Thanks. |
|
Persistent review updated to latest commit 957d58f |
|
❌ Gradle check result for 957d58f: null Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Description
This PR adds support for
fromandsizeparameters in terms lookup queries, enabling pagination when fetching terms from a lookup index. This is particularly useful when dealing with large lookup datasets where fetching all terms at once is not efficient or exceeds system limits.100% AI generated
Related Issues
Resolves #20865
Changes
fromandsizefields toTermsLookupclassTermsLookupconstructors, getters, setters, and builder methodsTermsQueryBuilder.fetch()to use user-specifiedfromandsizeparametersUsage Example
{ "terms": { "ASIN": { "index": "membership-index", "path": "ASIN", "query": { "term": { "userId": "user123" } }, "from": 0, "size": 10000 } } }Testing
171_terms_lookup_query.yml:sizeparameter limits number of terms fetchedfromparameter skips first N termsfromandsizeparameterssize=0returns no terms./gradlew spotlessApplyCheck List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.