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

Use Set instead of LongSet in double script field #85475

Merged
merged 6 commits into from
Apr 1, 2022

Conversation

rjernst
Copy link
Member

@rjernst rjernst commented Mar 30, 2022

The double script field uses hppc's LongSet to store the unique values
to be queried. However, this set should be relatively small. This commit
changes the internals of the runtime double script field to use Set.

relates #84735

The double script field uses hppc's LongSet to store the unique values
to be queried. However, this set should be relatively small. This commit
changes the internals of the runtime double script field to use Set.

relates elastic#84735
@rjernst rjernst added :Search/Search Search-related issues that do not fall into other categories >refactoring v8.2.0 labels Mar 30, 2022
@rjernst rjernst requested a review from nik9000 March 30, 2022 02:10
@elasticmachine elasticmachine added the Team:Search Meta label for search team label Mar 30, 2022
@elasticmachine
Copy link
Collaborator

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

Copy link
Member

@dnhatn dnhatn left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks Ryan!

@@ -66,8 +64,8 @@ public boolean equals(Object obj) {
double[] terms() {
double[] result = new double[terms.size()];
int i = 0;
for (LongCursor lc : terms) {
result[i++] = Double.longBitsToDouble(lc.value);
for (long l : terms) {
Copy link
Member

Choose a reason for hiding this comment

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

nit: maybe replace this with stream/mapToDouble.

@rjernst rjernst merged commit 578f95e into elastic:master Apr 1, 2022
@rjernst rjernst deleted the hppc/double_scriptfield branch April 1, 2022 01:29
@rjernst rjernst mentioned this pull request Apr 1, 2022
43 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>refactoring :Search/Search Search-related issues that do not fall into other categories Team:Search Meta label for search team v8.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants