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

Add cross cluster support to _terms_enum #73478

Merged
merged 6 commits into from
Jun 9, 2021
Merged

Conversation

jimczi
Copy link
Contributor

@jimczi jimczi commented May 27, 2021

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

This commit adds the support to search cross cluster indices (with the cross cluster syntax)
 in the _terms_enum API.

Relates elastic#71550
@jimczi jimczi added >non-issue :Search/Search Search-related issues that do not fall into other categories v8.0.0 v7.14.0 labels May 27, 2021
@jimczi jimczi requested a review from markharwood May 27, 2021 13:52
@elasticmachine elasticmachine added the Team:Search Meta label for search team label May 27, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search (Team:Search)

if (lastTerm != null && results.size() < request.size()) {
results.add(lastTerm.getTerm());
}

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 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.

Copy link
Contributor

@markharwood markharwood left a 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

Copy link
Contributor

@jtibshirani jtibshirani left a 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();
Copy link
Contributor

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.

@jimczi jimczi merged commit 93b3b6c into elastic:master Jun 9, 2021
@jimczi jimczi deleted the ccs_terms_enum branch June 9, 2021 13:52
jimczi added a commit to jimczi/elasticsearch that referenced this pull request Jun 9, 2021
This commit adds the support to search cross cluster indices (with the cross cluster syntax)
 in the _terms_enum API.

Relates elastic#71550
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>non-issue :Search/Search Search-related issues that do not fall into other categories Team:Search Meta label for search team v7.14.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants