Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow specifying max results in NativeSearchQueryBuilder [DATAES-988] #1561

Closed
spring-projects-issues opened this issue Nov 30, 2020 · 0 comments
Labels
type: enhancement A general enhancement

Comments

@spring-projects-issues
Copy link

Patrick Strawderman opened DATAES-988 and commented

It would be useful to have a "withMaxResults" method to NativeSearchQueryBuilder for specifying the maxResults on the built Query. This is common for aggregation queries where search hits are not needed.

Having the builder method for setting maxResults is a minor ergonomic improvement, e.g.

NativeSearchQuery searchQuery = NativeSearchQueryBuilder()
    .withQuery(matchAllQuery())
    .addAggregation(terms("examples").field("example"))
    .withMaxResults(0)
    .build();

versus what is required now:

NativeSearchQuery searchQuery = NativeSearchQueryBuilder()
    .withQuery(matchAllQuery())
    .addAggregation(terms("examples").field("example"))
    .build();
searchQuery.setMaxResults(0);


Referenced from: pull request #561

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

1 participant