Skip to content

Conversation

@mkhludnev
Copy link
Contributor

@mkhludnev mkhludnev commented May 22, 2025

Description

Avoid clauses limit what searching terms_query for IP/masks over docValues fields.

Related Issues

Resolves #17394

Check List

  • Functionality includes testing.

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.

@github-actions
Copy link
Contributor

❌ Gradle check result for bf21595: 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?

@github-actions
Copy link
Contributor

❌ Gradle check result for 9493dd7: 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?

@github-actions
Copy link
Contributor

❌ Gradle check result for d88fea8: 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 added 3 commits May 24, 2025 00:06
Signed-off-by: Mikhail Khludnev <[email protected]>
Signed-off-by: Mikhail Khludnev <[email protected]>
@mkhludnev mkhludnev force-pushed the GH173394-tmsq-ipmasks-dv0nly branch from 1758202 to 4ad17d8 Compare May 23, 2025 21:07
@mkhludnev mkhludnev marked this pull request as ready for review May 23, 2025 21:09
@mkhludnev mkhludnev changed the title search IP/masks via dvFields search over 1K IP/masks via DV fields May 23, 2025
@mkhludnev mkhludnev changed the title search over 1K IP/masks via DV fields search 1K IP/masks via terms_query over DV-only fields May 23, 2025
@mkhludnev mkhludnev changed the title search 1K IP/masks via terms_query over DV-only fields Allow searching 1K+ IP/masks in DV-only fields via terms_query May 23, 2025
@github-actions
Copy link
Contributor

✅ Gradle check result for 4ad17d8: SUCCESS

@codecov
Copy link

codecov bot commented May 23, 2025

Codecov Report

Attention: Patch coverage is 81.03448% with 11 lines in your changes missing coverage. Please review.

Project coverage is 72.66%. Comparing base (d52cefa) to head (6fb5c76).
Report is 33 commits behind head on main.

Files with missing lines Patch % Lines
...ava/org/opensearch/index/mapper/IpFieldMapper.java 81.03% 5 Missing and 6 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #18357      +/-   ##
============================================
- Coverage     72.74%   72.66%   -0.09%     
+ Complexity    67767    67726      -41     
============================================
  Files          5497     5504       +7     
  Lines        311815   311928     +113     
  Branches      45261    45284      +23     
============================================
- Hits         226822   226648     -174     
- Misses        66504    66781     +277     
- Partials      18489    18499      +10     

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

@github-actions
Copy link
Contributor

github-actions bot commented Jun 3, 2025

❌ Gradle check result for 6fb5c76: 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

org.opensearch.upgrades.FullClusterRestartIT.testRecovery
Seems like an irrelevant flaky test failure

@mkhludnev
Copy link
Contributor Author

Hello,
Kindly asking for considering it?

@rishabhmaurya
Copy link
Contributor

@mkhludnev thanks for the lucene contribution and using it here. I wondering what other places we can exploit the use of DocValuesMultiRangeQuery?

@mkhludnev
Copy link
Contributor Author

mkhludnev commented Jun 10, 2025

Thanks @rishabhmaurya I also though about it, at the first glimpse there is no many field types letting to pass a range into terms query. Let me double check ranges and especially IP range.

@github-actions
Copy link
Contributor

✅ Gradle check result for 6fb5c76: SUCCESS

@rishabhmaurya rishabhmaurya merged commit 7ab5c59 into opensearch-project:main Jun 10, 2025
33 of 35 checks passed
@mkhludnev
Copy link
Contributor Author

Thanks for merging this. Aren't there a backport duty now?

@rishabhmaurya
Copy link
Contributor

looks like 2.x still pointing to old lucene version -

lucene = "9.12.1"

@mkhludnev
Copy link
Contributor Author

Right. Got it now. Thanks

q-andy pushed a commit to q-andy/OpenSearch that referenced this pull request Jun 11, 2025
…earch-project#18357)

* search IP/masks via dvFields

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

* sight test adjustment

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

* test adjustment + mimicking old behavior

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

* assert over 1K clauses

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

* shaping the code

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

---------

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

I wondering what other places we can exploit the use of DocValuesMultiRangeQuery

Cant' find a low hanging fruit here. Potentially it could be:

  • rewriting bool {should [{range:{}}, ...{range:{}}] } into DV multirange. Not sure if users need it.
  • it could be possible if we introduce range mini-syntax for terms:{"fld":["1 TO 2", "2 TO 3"]}, nothing like this even for range fields exists now.
  • even for IP range fields there's no CIDR syntax support for terms:{"ip_range_fld":["1.2.3.4/24", "1.2.3.5/22"]}

So, looks like we can put it on-hold until we get a request from users.

@rishabhmaurya
Copy link
Contributor

@mkhludnev I like these ideas especially rewriting the boolean queries. Do you think this approach can result in better performance for some of these boolean queries?

@mkhludnev
Copy link
Contributor Author

I'm afraid it's a quite rare case. Let's wait for a particular user.

abhita pushed a commit to abhita/OpenSearch that referenced this pull request Jun 17, 2025
…earch-project#18357)

* search IP/masks via dvFields

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

* sight test adjustment

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

* test adjustment + mimicking old behavior

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

* assert over 1K clauses

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

* shaping the code

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

---------

Signed-off-by: Mikhail Khludnev <[email protected]>
Signed-off-by: Mikhail Khludnev <[email protected]>
neuenfeldttj pushed a commit to neuenfeldttj/OpenSearch that referenced this pull request Jun 26, 2025
…earch-project#18357)

* search IP/masks via dvFields

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

* sight test adjustment

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

* test adjustment + mimicking old behavior

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

* assert over 1K clauses

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

* shaping the code

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

---------

Signed-off-by: Mikhail Khludnev <[email protected]>
Signed-off-by: Mikhail Khludnev <[email protected]>Signed-off-by: TJ Neuenfeldt <[email protected]>
neuenfeldttj pushed a commit to neuenfeldttj/OpenSearch that referenced this pull request Jun 26, 2025
…earch-project#18357)

* search IP/masks via dvFields

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

* sight test adjustment

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

* test adjustment + mimicking old behavior

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

* assert over 1K clauses

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

* shaping the code

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

---------

Signed-off-by: Mikhail Khludnev <[email protected]>
Signed-off-by: Mikhail Khludnev <[email protected]>
tandonks pushed a commit to tandonks/OpenSearch that referenced this pull request Aug 5, 2025
…earch-project#18357)

* search IP/masks via dvFields

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

* sight test adjustment

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

* test adjustment + mimicking old behavior

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

* assert over 1K clauses

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

* shaping the code

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

---------

Signed-off-by: Mikhail Khludnev <[email protected]>
Signed-off-by: Mikhail Khludnev <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Enhancement or improvement to existing feature or request Search:Query Capabilities

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] unlimit IP/masks terms query for doc_values only fields

2 participants