QueryVariantDsl
Type-safe DSL for building Elasticsearch queries using metamodel-based field references.
This DSL provides a fluent, Kotlin-idiomatic API for constructing Elasticsearch queries with compile-time type safety. Instead of using string-based field names, queries are built using generated metamodel field references, preventing runtime errors from typos or incorrect field paths.
Key Features
Type-safe field references: Use metamodel properties instead of string literals
Fluent query composition: Chain query builders with infix operators
Nested and object field support: Navigate complex document structures with dot notation
Comprehensive query coverage: Support for all major Elasticsearch query types
Supported Query Types
Full-text queries: match, multiMatch, matchPhrase, matchPhrasePrefix
Term-level queries: term, terms, termsSet, wildCard, prefix, regexp
Boolean queries: bool, shouldAtLeastOneOf, disMax
Range queries: range, greaterThan, lowerThan, mustBeBetween
Nested queries: nested
Specialized queries: fuzzy, exist, geoDistance, moreLikeThis
Elasticsearch Query dsl documentation
See also
for boolean query composition
Functions
Creates a nested BoolQuery inside the current typed occurrence of the BoolQueryDsl
creates Combined fields query
creates Common terms query
creates Match query
creates Term query
creates Terms query
creates Disjunction max query
creates Exists query
creates Geo-distance query
creates Range query
creates Range query
creates Range query
creates Range query
creates Match query
creates Match all query
creates Match none query
creates Match phrase query
creates Match phrase prefix query
creates More like this query
creates Multi-match query
creates Range query
creates Nested query
creates Range query
creates Regexp query
Creates a nested BoolQuery inside the current typed occurrence of the BoolQueryDsl
creates Term query
creates Terms query
creates Terms set query