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
feat: Sorting for search results #121
Conversation
Codecov Report
@@ Coverage Diff @@
## main #121 +/- ##
============================================
+ Coverage 83.00% 83.47% +0.46%
- Complexity 616 646 +30
============================================
Files 68 72 +4
Lines 1948 2015 +67
Branches 166 173 +7
============================================
+ Hits 1617 1682 +65
- Misses 296 297 +1
- Partials 35 36 +1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
import java.util.Objects; | ||
|
||
/** Represents a collection field and corresponding sort order */ | ||
public final class FieldSort implements TigrisSort { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In future we can extend this further
class GeoDistanceSort implements TigrisSort {}
Sort.geoDistance(String fieldName, GeoLocation loc)
client/src/main/java/com/tigrisdata/db/client/SortingOperator.java
Outdated
Show resolved
Hide resolved
} | ||
|
||
@Override | ||
public boolean equals(Object o) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: in other places in this library. I have been using IDE generated equals and hashCode (Java 7+) with java.util.Objects
* @return {@link SearchRequest.Builder} | ||
*/ | ||
public Builder withSortOrder(SortOrder sortOrder) { | ||
public Builder withSort(SortingOrder sortOrder) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are the use cases when this method is useful vs the following?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add a rpc method test to exercise the full trip?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Allow sharing of SortingOrder
between search requests. Or if we introduce sorting for read.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense.
Interface to allow users to specify sort order for search results.
OR