Skip to content

backport sorted BytesRef to TermInSet #17714 to 2.x #17916

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

Conversation

mkhludnev
Copy link
Contributor

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

mkhludnev and others added 3 commits April 12, 2025 12:42
…#17714)

* pass in order terms as sorted to TermInSetQuery()

Signed-off-by: Mikhail Khludnev <[email protected]>

* slightly more elegant solution

Signed-off-by: Mikhail Khludnev <[email protected]>

* Attempting mocking TermInSetQ constructor.

Signed-off-by: Mikhail Khludnev <[email protected]>

* Handle ids as well.

Signed-off-by: Mikhail Khludnev <[email protected]>

* forbidden api

Signed-off-by: Mikhail Khludnev <[email protected]>

* make unnecessary method slow but correct.

Signed-off-by: Mikhail Khludnev <[email protected]>

* make unnecessary method slow but correct.

Signed-off-by: Mikhail Khludnev <[email protected]>

* Polish test coverage

Signed-off-by: Mikhail Khludnev <[email protected]>

* CHANGELOG.md

Signed-off-by: Mikhail Khludnev <[email protected]>

* assertThrows

Signed-off-by: Mikhail Khludnev <[email protected]>

* spotlessApply

Signed-off-by: Mikhail Khludnev <[email protected]>

* coverage tests and refactoring

Signed-off-by: Mikhail Khludnev <[email protected]>

* javadoc

Signed-off-by: Mikhail Khludnev <[email protected]>

* javadoc

Signed-off-by: Mikhail Khludnev <[email protected]>

* mark nocommit

Signed-off-by: Mikhail Khludnev <[email protected]>

* one more nocommit test

Signed-off-by: Mikhail Khludnev <[email protected]>

* forbidden api

Signed-off-by: Mikhail Khludnev <[email protected]>

* no commit for out of line tests

Signed-off-by: Mikhail Khludnev <[email protected]>

* Review

Signed-off-by: Mikhail Khludnev <[email protected]>

---------

Signed-off-by: Mikhail Khludnev <[email protected]>
Signed-off-by: Mikhail Khludnev <[email protected]>
Signed-off-by: Mikhail Khludnev <[email protected]>
Followup for opensearch-project#17714: Remove redundant tests (opensearch-project#17902)
* Remove redundant tests

Signed-off-by: Mikhail Khludnev <[email protected]>

* Fix empty collection test

Signed-off-by: Mikhail Khludnev <[email protected]>

---------

Signed-off-by: Mikhail Khludnev <[email protected]>
@mkhludnev
Copy link
Contributor Author

this also includes backporting #17902 fix

@mkhludnev
Copy link
Contributor Author

@jainankitk you are welcome

Copy link
Contributor

❌ Gradle check result for 46bbb92: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@mkhludnev
Copy link
Contributor Author

@jainankitk may you consider for merging this backport? Please!

@mkhludnev
Copy link
Contributor Author

Please backport.

@jainankitk
Copy link
Contributor

@jainankitk may you consider for merging this backport? Please!

Sorry, missed this earlier. Approved now, will retry the gradle check

Copy link
Contributor

❕ Gradle check result for 46bbb92: UNSTABLE

Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure.

Copy link

codecov bot commented Apr 21, 2025

Codecov Report

Attention: Patch coverage is 98.41270% with 1 line in your changes missing coverage. Please review.

Project coverage is 71.95%. Comparing base (03b7d62) to head (46bbb92).
Report is 5 commits behind head on 2.x.

Files with missing lines Patch % Lines
...earch/index/mapper/BytesRefsCollectionBuilder.java 97.50% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##                2.x   #17916      +/-   ##
============================================
- Coverage     71.99%   71.95%   -0.04%     
+ Complexity    66114    66081      -33     
============================================
  Files          5348     5352       +4     
  Lines        307550   307683     +133     
  Branches      44906    44919      +13     
============================================
- Hits         221409   221394      -15     
- Misses        67714    67859     +145     
- Partials      18427    18430       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jainankitk jainankitk merged commit 6f42e8b into opensearch-project:2.x Apr 21, 2025
68 checks passed
@mkhludnev
Copy link
Contributor Author

Is it worth to add into terms_query documentation advice about pre-sorting terms?

@jainankitk
Copy link
Contributor

Is it worth to add into terms_query documentation advice about pre-sorting terms?

Yes, we can call this out in the documentation explicitly. Probably needs to go here - https://docs.opensearch.org/docs/latest/query-dsl/term/terms-set/ ?

@mkhludnev
Copy link
Contributor Author

Yes, we can call this out in the documentation explicitly. Probably needs to go here - https://docs.opensearch.org/docs/latest/query-dsl/term/terms-set/ ?

In DSL it's terms, not terms_set. Here, we go opensearch-project/documentation-website#9677

ref: #17714

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants