Skip to content

Conversation

@karenyrx
Copy link
Contributor

Description

Implement GRPC boolean query.
Since boolean query is a query type which can take in other query types, it needs access to the internal query registry, so this PR also adds a mechanism to loop through all registered built-in query converters (i.e. those implemented in core, and not in an extenral plugin), to inject the registry into them.

Test Plan

Started a local opensearch cluster and run a bool query, with a term/terms/matchall query inside:


grpcurl -import-path ~/opensearch -d '
{  
  "request_body": {    
    "query": {           
      "bool": {
        "must": [
          {
            "term": {
              "field": "category",
              "value": {
                "string": "books"
              }
            }
          },
          {
            "match_all": {
            }
          },
          {
            "terms": {
              "terms": {
                "category": {
                  "field_value_array": {
                    "field_value_array": [
                      {"string": "books"},
                      {"string": "electronics"},
                      {"string": "clothing"}
                    ]
                  }
                }
              },
              "x_name": "my_terms_query"
            }
          }
        ]
      }
    }
  }
}' -proto ~/opensearch/protos/services/search_service.proto -plaintext localhost:9400 org.opensearch.protobufs.services.SearchService/Search
{
  "xShards": {},
  "hits": {
    "total": {
      "totalHits": {
        "relation": "TOTAL_HITS_RELATION_EQ"
      }
    },
    "maxScore": {
      "float": 0
    }
  }
}

Related Issues

Resolves #19390

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.

@github-actions github-actions bot added _No response_ enhancement Enhancement or improvement to existing feature or request labels Sep 24, 2025
Signed-off-by: Karen X <[email protected]>
Signed-off-by: Karen X <[email protected]>
@github-actions
Copy link
Contributor

✅ Gradle check result for cabda94: SUCCESS

@codecov
Copy link

codecov bot commented Sep 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.00%. Comparing base (cef8d98) to head (550904b).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main   #19391      +/-   ##
============================================
+ Coverage     72.90%   73.00%   +0.10%     
- Complexity    70014    70072      +58     
============================================
  Files          5681     5683       +2     
  Lines        321457   321523      +66     
  Branches      46486    46500      +14     
============================================
+ Hits         234347   234717     +370     
+ Misses        68187    67868     -319     
- Partials      18923    18938      +15     

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

@karenyrx karenyrx changed the title [GRPC] Implement Boolean query and inject registry for all built-in query converters [GRPC][Compound queries] Implement Boolean query and inject registry for all built-in query converters Sep 29, 2025
@github-actions github-actions bot added the Search Search query, autocomplete ...etc label Sep 29, 2025
@github-actions
Copy link
Contributor

❌ Gradle check result for 415a4e0: 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 415a4e0: null

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?

@karenyrx karenyrx closed this Sep 29, 2025
@karenyrx karenyrx reopened this Sep 29, 2025
Signed-off-by: Karen X <[email protected]>
@github-actions
Copy link
Contributor

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

Signed-off-by: Karen X <[email protected]>
@karenyrx karenyrx marked this pull request as ready for review September 29, 2025 19:09
@karenyrx karenyrx requested a review from a team as a code owner September 29, 2025 19:09
@github-actions
Copy link
Contributor

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

@karenyrx
Copy link
Contributor Author

karenyrx commented Sep 29, 2025

Unrelated test failure

> Task :server:test

Tests with failures:
 - org.opensearch.cluster.routing.allocation.AllocationConstraintsTests.testAllConstraints

@karenyrx karenyrx closed this Sep 29, 2025
@karenyrx karenyrx reopened this Sep 29, 2025
@github-actions
Copy link
Contributor

✅ Gradle check result for 334b3da: SUCCESS

@github-actions
Copy link
Contributor

❕ Gradle check result for 550904b: 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.

@cwperks cwperks merged commit ae140b5 into opensearch-project:main Sep 30, 2025
33 checks passed
peteralfonsi pushed a commit to peteralfonsi/OpenSearch that referenced this pull request Oct 15, 2025
…for all built-in query converters (opensearch-project#19391)

* [GRPC] Implement Boolean query and inject registry for all internal converters

Signed-off-by: karenx <[email protected]>

* update CHANGELOG

Signed-off-by: Karen X <[email protected]>

* delete extra file

Signed-off-by: Karen X <[email protected]>

* remove dead code and update tests

Signed-off-by: Karen X <[email protected]>

* pakcage private

Signed-off-by: Karen X <[email protected]>

* spotless and compile
Signed-off-by: Karen X <[email protected]>

* pass registry instead of making it static

Signed-off-by: Karen X <[email protected]>

---------

Signed-off-by: karenx <[email protected]>
Signed-off-by: Karen X <[email protected]>
Co-authored-by: karenx <[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 _No response_ Search Search query, autocomplete ...etc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] Implement GRPC Boolean Query

3 participants