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

IP field via MultrangeQuery fix #16200 #16391

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

mkhludnev
Copy link
Contributor

@mkhludnev mkhludnev commented Oct 19, 2024

Description

Combines a many concrete IPs and CIDR masks into set when querying IP field

Related Issues

Resolves #16200

Check List

  • Functionality includes testing.
  • API changes companion pull request created, if applicable.
  • Public documentation issue/PR created, if applicable.

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 5 commits October 18, 2024 01:04
Signed-off-by: mikhail-khludnev <[email protected]>
Signed-off-by: mikhail-khludnev <[email protected]>
Signed-off-by: mikhail-khludnev <[email protected]>
@github-actions github-actions bot added enhancement Enhancement or improvement to existing feature or request Search:Query Capabilities labels Oct 19, 2024
Copy link
Contributor

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

Copy link
Contributor

❌ Gradle check result for c9e2bd1: 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 and others added 2 commits October 19, 2024 21:51
Signed-off-by: mikhail-khludnev <[email protected]>
Signed-off-by: mikhail-khludnev <[email protected]>
Copy link
Contributor

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

it's an alt of #16202

InetAddress address;
List<InetAddress> concreteIPs = new ArrayList<>();
List<Query> ranges = new ArrayList<>();
IpMultiRangeQueryBuilder multiRange = new IpMultiRangeQueryBuilder(name());
Copy link
Contributor Author

Choose a reason for hiding this comment

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

MultiRangeQuery handles points index, but there's no a special case for DV only field.

Signed-off-by: mikhail-khludnev <[email protected]>
Copy link
Contributor

github-actions bot commented Nov 8, 2024

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

Copy link
Contributor

❌ Gradle check result for 26ff736: 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 referenced this pull request Nov 12, 2024
* Updating Ip fields to use doc_values to search

Signed-off-by: Harsha Vamsi Kalluri <[email protected]>

* Fix IP tests

Signed-off-by: Harsha Vamsi Kalluri <[email protected]>

* Fix skip to allow yaml test to pass on main

Signed-off-by: Harsha Vamsi Kalluri <[email protected]>

* Update tests to use existing test file

Signed-off-by: Harsha Vamsi Kalluri <[email protected]>

* Changing skip version to match bwc

Signed-off-by: Harsha Vamsi Kalluri <[email protected]>

* Using exact match instead of range

Signed-off-by: Harsha Vamsi Kalluri <[email protected]>

* Spotless

Signed-off-by: Harsha Vamsi Kalluri <[email protected]>

* Fix IP field tests

Signed-off-by: Harsha Vamsi Kalluri <[email protected]>

* Fix spotless + precommit failure

Signed-off-by: Harsha Vamsi Kalluri <[email protected]>

* Get point out of query and into value

Signed-off-by: Harsha Vamsi Kalluri <[email protected]>

* Fix term tests

Signed-off-by: Harsha Vamsi Kalluri <[email protected]>

* Add skip test logic to only doc_values test

Signed-off-by: Harsha Vamsi Kalluri <[email protected]>

---------

Signed-off-by: Harsha Vamsi Kalluri <[email protected]>
add filter

Signed-off-by: mikhail-khludnev <[email protected]>
Copy link
Contributor

❌ Gradle check result for 01db875: 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

TODO

hard rebase over #16628

@mkhludnev
Copy link
Contributor Author

Here we come to the question. Think about terms_query for IP/masks (this what I want to do here).

num of masks index-only docVals-only index&dvs
<maxClauses MultiRangeQ BQ { ssDvRangeQ, ..} MultiRangeQ && BQ{ssDvRangeQ,..}
>maxClauses MultiRangeQ exception (until ssDvMultiRange) MultiRangeQ (no chance for ssDvRangeQ)

The first question is to confirm this plan. So, WDYT?

Then, notice <maxClauses condition, the exact number is a question. IpFieldMapper parses terms_query only. But it has no information about number of enclosing BQs, even think about top level bool. Its' clauses are counted under overall maxClause limit. It seems like if we go with numclause condition logic we can't reasonably set the limit.
I don't want to introduce settings since the problem should gone after introducing ssDvMultiRange. The compromise is to set to something like <IndexSearcher.getMaxClausesCount()/2.
Wdyt?

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] relax max Clauses Count limitation of termS query over IP field
1 participant