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

Allow doc value search on unindexed boolean and date fields #11650

Merged
merged 26 commits into from
May 2, 2024

Conversation

harshavamsi
Copy link
Contributor

@harshavamsi harshavamsi commented Dec 19, 2023

Description

Fixes remaining field mappers that support doc_values based searching to make use of IndexOrDocValuesQuery where applicable.

Related Issues

Resolves #11205

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Failing checks are inspected and point to the corresponding known issue(s) (See: Troubleshooting Failing Builds)
  • Commits are signed per the DCO using --signoff
  • Commit changes are listed out in CHANGELOG.md file (See: Changelog)
  • Public documentation issue/PR created

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 github-actions bot added enhancement Enhancement or improvement to existing feature or request Search:Performance v2.12.0 Issues and PRs related to version 2.12.0 labels Dec 19, 2023
Copy link
Contributor

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

github-actions bot commented Dec 19, 2023

Compatibility status:

Checks if related components are compatible with change 1914641

Incompatible components

Skipped components

Compatible components

Compatible components: [https://github.com/opensearch-project/custom-codecs.git, https://github.com/opensearch-project/asynchronous-search.git, https://github.com/opensearch-project/neural-search.git, https://github.com/opensearch-project/flow-framework.git, https://github.com/opensearch-project/job-scheduler.git, https://github.com/opensearch-project/reporting.git, https://github.com/opensearch-project/cross-cluster-replication.git, https://github.com/opensearch-project/security-analytics.git, https://github.com/opensearch-project/opensearch-oci-object-storage.git, https://github.com/opensearch-project/geospatial.git, https://github.com/opensearch-project/notifications.git, https://github.com/opensearch-project/common-utils.git, https://github.com/opensearch-project/k-nn.git, https://github.com/opensearch-project/observability.git, https://github.com/opensearch-project/anomaly-detection.git, https://github.com/opensearch-project/performance-analyzer-rca.git, https://github.com/opensearch-project/ml-commons.git, https://github.com/opensearch-project/index-management.git, https://github.com/opensearch-project/security.git, https://github.com/opensearch-project/sql.git, https://github.com/opensearch-project/alerting.git, https://github.com/opensearch-project/performance-analyzer.git]

Copy link
Contributor

❌ Gradle check result for fd22221: 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 a843bf4: 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 52c5247: 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 a71bc21: 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?

@harshavamsi
Copy link
Contributor Author

@dblock @msfroh merge?

@dblock
Copy link
Member

dblock commented Apr 30, 2024

❕ Gradle check result for 7444538: UNSTABLE

  • TEST FAILURES:
      1 org.opensearch.repositories.azure.AzureBlobContainerRetriesTests.testWriteBlobWithRetries

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

Test Result (1 failure / -353)
org.opensearch.repositories.azure.AzureBlobContainerRetriesTests.testWriteBlobWithRetries

#7934

@dblock
Copy link
Member

dblock commented Apr 30, 2024

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

Test Result (2 failures / +1)
org.opensearch.index.query.TermsQueryBuilderTests.testToQuery
org.opensearch.index.remote.RemoteSegmentTransferTrackerTests.testComputeTimeLagOnUpdate

@harshavamsi at least testToQuery looks new, care to review and open a bug please?

Copy link
Contributor

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

@harshavamsi harshavamsi force-pushed the doc_values_searching branch 2 times, most recently from 52747c7 to f690458 Compare April 30, 2024 15:55
Copy link
Contributor

❌ Gradle check result for 52747c7: 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 65c84c2: 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 f690458: 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 65c84c2: 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?

@harshavamsi
Copy link
Contributor Author

@dblock looks like all these are flaky tests

@dblock
Copy link
Member

dblock commented May 1, 2024

@dblock looks like all these are flaky tests

Can you please look at the logs and link the failed tests?

Copy link
Contributor

github-actions bot commented May 1, 2024

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

@harshavamsi
Copy link
Contributor Author

@dblock looks like all these are flaky tests

Can you please look at the logs and link the failed tests?

Opened #13487, #13480, and #13479

Copy link
Collaborator

@VachaShah VachaShah left a comment

Choose a reason for hiding this comment

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

LGTM! @harshavamsi Does this need any documentation updates?

@harshavamsi
Copy link
Contributor Author

LGTM! @harshavamsi Does this need any documentation updates?

@VachaShah I fixed the documentation in an earlier effort here -- opensearch-project/documentation-website#5619

Copy link
Contributor

github-actions bot commented May 2, 2024

✅ Gradle check result for 921dee5: SUCCESS

@VachaShah VachaShah merged commit dc77c46 into opensearch-project:main May 2, 2024
27 of 28 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request May 2, 2024
* Making fields searchable

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

* Adding tests for boolean fields

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

* Added tests for date fields

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

* Updating termsQuery logic

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

* Spotless

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

* Updating terms test

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

* Spotless

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

* Ensure that the points are intersecting for doc_values

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

* Spotless

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

* Adding missing javadocs

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

* Adding more tests for indexedValueForSearch

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

* Adding MatchAllDocsQuery to asserts

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

* Fix changelog

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

* Simplify loop criteria + remove IndexOrDocValuesQuery

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

* Add some comments

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

* Fix indendation

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

* Fixing boolean field tests

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

* Revert to correct logic for termsQuery

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

* Update terms logic to be more succinct

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

* Fix terms test

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

* Adding tests for boolean range query + fix range query to use term query inside

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

* Checking if upper and lower terms are valid

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

* Checking if upper and lower terms are valid

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

* Fixing changelog

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

---------

Signed-off-by: Harsha Vamsi Kalluri <[email protected]>
(cherry picked from commit dc77c46)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@msfroh
Copy link
Collaborator

msfroh commented May 2, 2024

@harshavamsi, #13480 is almost certainly a result of this change.

The TermsQueryBuilder expects to get one of a few query types, but because of this change, it's able to get a TermQuery instead.

VachaShah pushed a commit that referenced this pull request May 2, 2024
…13514)

* Making fields searchable



* Adding tests for boolean fields



* Added tests for date fields



* Updating termsQuery logic



* Spotless



* Updating terms test



* Spotless



* Ensure that the points are intersecting for doc_values



* Spotless



* Adding missing javadocs



* Adding more tests for indexedValueForSearch



* Adding MatchAllDocsQuery to asserts



* Fix changelog



* Simplify loop criteria + remove IndexOrDocValuesQuery



* Add some comments



* Fix indendation



* Fixing boolean field tests



* Revert to correct logic for termsQuery



* Update terms logic to be more succinct



* Fix terms test



* Adding tests for boolean range query + fix range query to use term query inside



* Checking if upper and lower terms are valid



* Checking if upper and lower terms are valid



* Fixing changelog



---------


(cherry picked from commit dc77c46)

Signed-off-by: Harsha Vamsi Kalluri <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
finnegancarroll pushed a commit to finnegancarroll/OpenSearch that referenced this pull request May 10, 2024
…ch-project#11650)

* Making fields searchable

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

* Adding tests for boolean fields

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

* Added tests for date fields

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

* Updating termsQuery logic

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

* Spotless

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

* Updating terms test

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

* Spotless

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

* Ensure that the points are intersecting for doc_values

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

* Spotless

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

* Adding missing javadocs

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

* Adding more tests for indexedValueForSearch

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

* Adding MatchAllDocsQuery to asserts

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

* Fix changelog

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

* Simplify loop criteria + remove IndexOrDocValuesQuery

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

* Add some comments

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

* Fix indendation

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

* Fixing boolean field tests

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

* Revert to correct logic for termsQuery

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

* Update terms logic to be more succinct

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

* Fix terms test

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

* Adding tests for boolean range query + fix range query to use term query inside

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

* Checking if upper and lower terms are valid

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

* Checking if upper and lower terms are valid

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

* Fixing changelog

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

---------

Signed-off-by: Harsha Vamsi Kalluri <[email protected]>
deshsidd pushed a commit to deshsidd/OpenSearch that referenced this pull request May 17, 2024
…ch-project#11650)

* Making fields searchable

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

* Adding tests for boolean fields

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

* Added tests for date fields

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

* Updating termsQuery logic

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

* Spotless

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

* Updating terms test

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

* Spotless

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

* Ensure that the points are intersecting for doc_values

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

* Spotless

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

* Adding missing javadocs

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

* Adding more tests for indexedValueForSearch

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

* Adding MatchAllDocsQuery to asserts

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

* Fix changelog

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

* Simplify loop criteria + remove IndexOrDocValuesQuery

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

* Add some comments

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

* Fix indendation

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

* Fixing boolean field tests

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

* Revert to correct logic for termsQuery

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

* Update terms logic to be more succinct

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

* Fix terms test

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

* Adding tests for boolean range query + fix range query to use term query inside

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

* Checking if upper and lower terms are valid

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

* Checking if upper and lower terms are valid

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

* Fixing changelog

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

---------

Signed-off-by: Harsha Vamsi Kalluri <[email protected]>
parv0201 pushed a commit to parv0201/OpenSearch that referenced this pull request Jun 10, 2024
…ch-project#11650)

* Making fields searchable

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

* Adding tests for boolean fields

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

* Added tests for date fields

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

* Updating termsQuery logic

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

* Spotless

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

* Updating terms test

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

* Spotless

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

* Ensure that the points are intersecting for doc_values

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

* Spotless

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

* Adding missing javadocs

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

* Adding more tests for indexedValueForSearch

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

* Adding MatchAllDocsQuery to asserts

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

* Fix changelog

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

* Simplify loop criteria + remove IndexOrDocValuesQuery

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

* Add some comments

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

* Fix indendation

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

* Fixing boolean field tests

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

* Revert to correct logic for termsQuery

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

* Update terms logic to be more succinct

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

* Fix terms test

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

* Adding tests for boolean range query + fix range query to use term query inside

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

* Checking if upper and lower terms are valid

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

* Checking if upper and lower terms are valid

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

* Fixing changelog

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

---------

Signed-off-by: Harsha Vamsi Kalluri <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x Backport to 2.x branch enhancement Enhancement or improvement to existing feature or request Search:Performance v2.14.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable doc_values based searching across different field types
6 participants