Skip to content

[elc] add support for sorting results by SortOptions to NativeQuery #2264

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

Merged
merged 1 commit into from
Aug 10, 2022

Conversation

xhaggi
Copy link
Contributor

@xhaggi xhaggi commented Aug 9, 2022

  • You have read the Spring Data contribution guidelines.
  • There is a ticket in the bug tracker for the project in our [issue tracker](https://github.
    com/spring-projects/spring-data-elasticsearch/issues)
    . Add the issue number to the Closes #issue-number line below
  • You use the code formatters provided here and have them applied to your changes. Don’t submit any formatting related changes.
  • You submit test cases (unit or integration tests) that back your changes.
  • You added yourself as author in the headers of the classes you touched. Amend the date range in the Apache license header if needed. For new types, add the license header (copy from another file and set the current year only).

Closes #2263

@xhaggi xhaggi requested a review from sothawo August 9, 2022 08:55
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Aug 9, 2022
@xhaggi xhaggi force-pushed the 2263-sort-by-sortoptions branch 3 times, most recently from dd269ad to 1cc4300 Compare August 9, 2022 09:04
Copy link
Collaborator

@sothawo sothawo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some minor remarks

@@ -129,6 +139,30 @@ public NativeQueryBuilder withScriptedField(ScriptedField scriptedField) {
return this;
}

public NativeQueryBuilder withSort(List<SortOptions> values) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we name them withSortOptions()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no strong opinion on this, but the BaseQueryBuilder also had a method withSort and the SearchRequest.Builder has a method called sort.

@xhaggi xhaggi force-pushed the 2263-sort-by-sortoptions branch from 1cc4300 to 1a751bf Compare August 10, 2022 08:12
@xhaggi xhaggi requested a review from sothawo August 10, 2022 08:12
@sothawo sothawo merged commit 6cfb8ee into spring-projects:main Aug 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage An issue we've not yet triaged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for sorting results via SortOptions of the Elasticsearch API client.
3 participants