Back to Opensearch

dsl-query-executor

sandbox/plugins/dsl-query-executor/README.md

3.7.01.5 KB
Original Source

dsl-query-executor

A front-end sandbox plugin to the analytics engine that intercepts _search requests, converts DSL queries into Calcite RelNode logical plans, and executes them through the analytics engine's query pipeline.

Supported Query Types

  • Term — equality filter
  • Terms — multi-value equality filter (uses query Filter with SEARCH and EQUALS)
  • Match All — matches all documents

Architecture

_search request
  → SearchActionFilter (intercepts SearchAction)
    → TransportDslExecuteAction (resolves index, orchestrates pipeline)
      → SearchSourceConverter (DSL → Calcite RelNode)
      → DslQueryPlanExecutor (delegates to analytics engine)
      → SearchResponseBuilder (builds SearchResponse)

Dependencies

  • analytics-engine — provides QueryPlanExecutor and EngineContext via Guice (declared as extendedPlugins)
  • analytics-framework — provides Calcite and shared SPI interfaces

Supported Queries

DSL QueryCalcite Representation
term=($field, value) — equality filter
match_allSkipped (boolean literal TRUE)
existsIS NOT NULL($field) — field existence check (boost not supported)

Running locally

bash
./gradlew run -PinstalledPlugins="['analytics-engine','dsl-query-executor']"

Testing

bash
# Unit tests
./gradlew :sandbox:plugins:dsl-query-executor:test

# Integration tests
./gradlew :sandbox:plugins:dsl-query-executor:internalClusterTest