-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Add cross cluster support to _terms_enum #73478
Conversation
This commit adds the support to search cross cluster indices (with the cross cluster syntax) in the _terms_enum API. Relates elastic#71550
Pinging @elastic/es-search (Team:Search) |
...n/core/src/main/java/org/elasticsearch/xpack/core/termsenum/action/NodeTermsEnumRequest.java
Show resolved
Hide resolved
...n/core/src/main/java/org/elasticsearch/xpack/core/termsenum/action/NodeTermsEnumRequest.java
Outdated
Show resolved
Hide resolved
if (lastTerm != null && results.size() < request.size()) { | ||
results.add(lastTerm.getTerm()); | ||
} | ||
|
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.
I ended up rewriting the logic to do a merge sort with a priority queue. The change is small but I can open a dedicated PR if that's preferred.
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.
Left a couple of minor comments but LGTM
...uster-search-security/src/test/resources/rest-api-spec/test/multi_cluster/120_terms_enum.yml
Show resolved
Hide resolved
...re/src/main/java/org/elasticsearch/xpack/core/termsenum/action/TransportTermsEnumAction.java
Outdated
Show resolved
Hide resolved
...re/src/main/java/org/elasticsearch/xpack/core/termsenum/action/TransportTermsEnumAction.java
Outdated
Show resolved
Hide resolved
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.
I'm not very familiar with this code (reviewed to learn about it), but it looks good to me.
|
||
public NodeTermsEnumRequest(StreamInput in) throws IOException { | ||
super(in); | ||
field = in.readString(); | ||
string = in.readString(); | ||
string = in.readOptionalString(); |
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.
Not for this PR, but it'd be good to have unit tests like NodeTermsEnumRequestTests
and TermsEnumRequestTests
that extend AbstractWireSerializingTestCase
, like we have for other requests.
This commit adds the support to search cross cluster indices (with the cross cluster syntax) in the _terms_enum API. Relates elastic#71550
This commit adds the support to search cross cluster indices (with the cross cluster syntax)
in the _terms_enum API.
This PR is marked as a non-issue since the API is new in 7.14.
Relates #71550