Skip to content

[Feature Request] [Star Tree] Support for SHOULD clauses across different dimensions in Star Tree indices #18081

Open
@imRishN

Description

@imRishN

Is your feature request related to a problem? Please describe

Currently with PR #17941, SHOULD clauses in bool queries are restricted to operate on the same dimension due to Star Tree's pre-aggregation structure. However, there are valid use cases where SHOULD across dimensions would be useful.

Example Use Case:

{
  "bool": {
    "should": [
      {
        "bool": {
          "must": [
            {"term": {"status": 200}},
            {"term": {"method": "GET"}}
          ]
        }
      },
      {
        "bool": {
          "must": [
            {"term": {"status": 404}},
            {"term": {"method": "POST"}}
          ]
        }
      }
    ]
  }
}

This query means: Match if either: (status=200 AND method=GET) OR (status=404 AND method=POST)

Current Behaviour:

  1. Rejects queries with SHOULD across dimensions
  2. Returns null from StarTreeFilterProvider
  3. Falls back to default implementation

Describe the solution you'd like

  1. Analyse if such queries can be efficiently supported with Star Tree structure
  2. Consider performance implications
  3. Evaluate if certain patterns can be optimised

Related component

Search:Aggregations

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

🆕 New

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions