|
| 1 | +--- |
| 2 | +sidebar_position: 8 |
| 3 | +title: DSL Compatibility Matrix |
| 4 | +description: Detailed compatibility matrix of Turing ES DSL Query API across Elasticsearch, Apache Solr, and Apache Lucene engines. |
| 5 | +--- |
| 6 | + |
| 7 | +# DSL Compatibility Matrix |
| 8 | + |
| 9 | +This page documents the compatibility level of every Turing ES DSL Query feature across the three supported search engine backends. |
| 10 | + |
| 11 | +**Legend:** |
| 12 | + |
| 13 | +| Symbol | Meaning | |
| 14 | +|--------|---------| |
| 15 | +| **Native** | Direct 1:1 mapping to the engine's API | |
| 16 | +| **Translated** | Converted to equivalent engine syntax (may have minor behavior differences) | |
| 17 | +| **Partial** | Basic support with limitations | |
| 18 | +| **Fallback** | Best-effort approximation (may not produce identical results) | |
| 19 | +| **N/A** | Not supported by the engine | |
| 20 | + |
| 21 | +--- |
| 22 | + |
| 23 | +## Queries (40 types) |
| 24 | + |
| 25 | +### Full-text Queries |
| 26 | + |
| 27 | +| Query | Elasticsearch | Solr | Lucene | |
| 28 | +|-------|:------------:|:----:|:------:| |
| 29 | +| `match` | **Native** | **Translated** `field:(terms)` | **Translated** `QueryParser` | |
| 30 | +| `multi_match` | **Native** | **Translated** multi-field OR | **Translated** `MultiFieldQueryParser` | |
| 31 | +| `match_phrase` | **Native** | **Translated** `field:"phrase"` | **Translated** `QueryParser` with quotes | |
| 32 | +| `match_phrase_prefix` | **Native** | **Translated** `field:"phrase"` | **Translated** `QueryParser` + prefix fallback | |
| 33 | +| `match_bool_prefix` | **Native** | **Translated** `+term +term prefix*` | **Translated** `TermQuery` MUST + `PrefixQuery` | |
| 34 | +| `combined_fields` | **Native** | **Translated** multi-field OR/AND | **Translated** `MultiFieldQueryParser` | |
| 35 | +| `query_string` | **Native** | **Translated** `field:(query)` | **Translated** `QueryParser` | |
| 36 | +| `simple_query_string` | **Native** | **Translated** multi-field OR | **Translated** `MultiFieldQueryParser` | |
| 37 | +| `match_all` | **Native** | **Translated** `*:*` | **Translated** `MatchAllDocsQuery` | |
| 38 | + |
| 39 | +### Term-level Queries |
| 40 | + |
| 41 | +| Query | Elasticsearch | Solr | Lucene | |
| 42 | +|-------|:------------:|:----:|:------:| |
| 43 | +| `term` | **Native** | **Translated** `field:"value"` | **Translated** `TermQuery` | |
| 44 | +| `terms` | **Native** | **Translated** `field:("a" OR "b")` | **Translated** `BooleanQuery` SHOULD | |
| 45 | +| `terms_set` | **Native** | **Fallback** terms OR | **Fallback** `BooleanQuery` SHOULD | |
| 46 | +| `range` | **Native** | **Translated** `field:[gte TO lte]` | **Translated** `TermRangeQuery` | |
| 47 | +| `exists` | **Native** | **Translated** `field:[* TO *]` | **Translated** `FieldExistsQuery` | |
| 48 | +| `prefix` | **Native** | **Translated** `field:value*` | **Translated** `PrefixQuery` | |
| 49 | +| `wildcard` | **Native** | **Translated** `field:pattern` | **Translated** `WildcardQuery` | |
| 50 | +| `regexp` | **Native** | **Translated** `field:/pattern/` | **Translated** `RegexpQuery` | |
| 51 | +| `fuzzy` | **Native** | **Translated** `field:value~N` | **Translated** `FuzzyQuery` | |
| 52 | +| `ids` | **Native** | **Translated** `id:("a" OR "b")` | **Translated** `BooleanQuery` on `id` | |
| 53 | + |
| 54 | +### Compound Queries |
| 55 | + |
| 56 | +| Query | Elasticsearch | Solr | Lucene | |
| 57 | +|-------|:------------:|:----:|:------:| |
| 58 | +| `bool` | **Native** | **Translated** `+(must) (should) -(must_not)` + `fq` for filter | **Translated** `BooleanQuery` with MUST/SHOULD/MUST_NOT/FILTER | |
| 59 | +| `constant_score` | **Native** | **Translated** passes through filter | **Translated** `ConstantScoreQuery` + `BoostQuery` | |
| 60 | +| `dis_max` | **Native** | **Translated** clauses joined with OR | **Translated** `DisjunctionMaxQuery` | |
| 61 | +| `boosting` | **Native** | **Translated** `+(positive) -(negative)` | **Translated** `BooleanQuery` MUST + MUST_NOT | |
| 62 | +| `function_score` | **Native** (full: weight, field_value_factor, decay, script) | **Partial** `{!boost}` with field_value_factor | **Partial** `BoostQuery` with weight | |
| 63 | +| `script_score` | **Native** | **Fallback** inner query only | **Fallback** inner query only | |
| 64 | +| `pinned` | **Native** | **Translated** ID boost `^1000` + organic | **Translated** `BoostQuery` on IDs | |
| 65 | + |
| 66 | +### Nested & Join Queries |
| 67 | + |
| 68 | +| Query | Elasticsearch | Solr | Lucene | |
| 69 | +|-------|:------------:|:----:|:------:| |
| 70 | +| `nested` | **Native** | **Fallback** inner query (flattened) | **Fallback** inner query (flattened) | |
| 71 | +| `has_child` | **Native** | **Fallback** inner query | **Fallback** inner query | |
| 72 | +| `has_parent` | **Native** | **Fallback** inner query | **Fallback** inner query | |
| 73 | + |
| 74 | +### Geo Queries |
| 75 | + |
| 76 | +| Query | Elasticsearch | Solr | Lucene | |
| 77 | +|-------|:------------:|:----:|:------:| |
| 78 | +| `geo_distance` | **Native** | **Translated** `{!geofilt}` | **Fallback** MatchAll | |
| 79 | +| `geo_bounding_box` | **Native** | **Translated** range `[lat,lon TO lat,lon]` | **Fallback** MatchAll | |
| 80 | +| `geo_shape` | **Native** | **Fallback** exists | **Fallback** MatchAll | |
| 81 | + |
| 82 | +### Vector Search |
| 83 | + |
| 84 | +| Query | Elasticsearch | Solr | Lucene | |
| 85 | +|-------|:------------:|:----:|:------:| |
| 86 | +| `knn` | **Native** | **Translated** `{!knn}` query parser | **Native** `KnnFloatVectorQuery` | |
| 87 | + |
| 88 | +### Span Queries |
| 89 | + |
| 90 | +| Query | Elasticsearch | Solr | Lucene | |
| 91 | +|-------|:------------:|:----:|:------:| |
| 92 | +| `span_term` | **Native** | **Translated** `field:"value"` | **Translated** `TermQuery` | |
| 93 | +| `span_near` | **Native** | **Translated** AND | **Translated** `BooleanQuery` MUST | |
| 94 | +| `span_or` | **Native** | **Translated** OR | **Translated** `BooleanQuery` SHOULD | |
| 95 | +| `span_not` | **Native** | **Translated** `+(incl) -(excl)` | **Translated** MUST + MUST_NOT | |
| 96 | +| `span_first` | **Native** | **Fallback** inner query | **Fallback** inner query | |
| 97 | + |
| 98 | +### Specialized Queries |
| 99 | + |
| 100 | +| Query | Elasticsearch | Solr | Lucene | |
| 101 | +|-------|:------------:|:----:|:------:| |
| 102 | +| `more_like_this` | **Native** | **Translated** `{!mlt}` | **Translated** `MultiFieldQueryParser` | |
| 103 | +| `intervals` | **Native** | **Translated** phrase query | **Translated** `QueryParser` phrase | |
| 104 | +| `rank_feature` | **Native** | **Fallback** exists | **Translated** `FieldExistsQuery` | |
| 105 | +| `distance_feature` | **Native** | **Fallback** exists | **Fallback** MatchAll | |
| 106 | +| `wrapper` | **Native** | **Fallback** `*:*` | **Fallback** MatchAll | |
| 107 | +| `percolate` | **Native** | **Fallback** `*:*` | **Fallback** MatchAll | |
| 108 | + |
| 109 | +--- |
| 110 | + |
| 111 | +## Aggregations (35 types) |
| 112 | + |
| 113 | +### Bucket Aggregations |
| 114 | + |
| 115 | +| Aggregation | Elasticsearch | Solr | Lucene | |
| 116 | +|-------------|:------------:|:----:|:------:| |
| 117 | +| `terms` | **Native** | **Translated** facet field | **Translated** manual term counting | |
| 118 | +| `range` | **Native** | **Translated** facet queries | N/A | |
| 119 | +| `date_histogram` | **Native** | N/A (warn) | N/A | |
| 120 | +| `histogram` | **Native** | N/A (warn) | N/A | |
| 121 | +| `filter` | **Native** | **Translated** facet query | **Translated** per-filter search | |
| 122 | +| `filters` | **Native** | **Translated** multiple facet queries | **Translated** per-filter search | |
| 123 | +| `significant_terms` | **Native** | **Translated** facet field | **Translated** terms agg fallback | |
| 124 | +| `rare_terms` | **Native** | **Partial** facet sort asc | **Translated** count <= max filter | |
| 125 | +| `nested` | **Native** | N/A (warn) | N/A | |
| 126 | +| `reverse_nested` | **Native** | N/A (warn) | N/A | |
| 127 | +| `auto_date_histogram` | **Native** | N/A (warn) | N/A | |
| 128 | +| `multi_terms` | **Native** | N/A (warn) | N/A | |
| 129 | +| `composite` | **Native** | N/A (warn) | N/A | |
| 130 | +| `sampler` | **Native** | N/A (warn) | N/A | |
| 131 | +| `diversified_sampler` | **Native** | N/A (warn) | N/A | |
| 132 | +| `adjacency_matrix` | **Native** | N/A (warn) | N/A | |
| 133 | +| `geo_distance` | **Native** | N/A (warn) | N/A | |
| 134 | +| `variable_width_histogram` | **Native** | N/A (warn) | N/A | |
| 135 | + |
| 136 | +### Metric Aggregations |
| 137 | + |
| 138 | +| Aggregation | Elasticsearch | Solr | Lucene | |
| 139 | +|-------------|:------------:|:----:|:------:| |
| 140 | +| `avg` | **Native** | **Translated** JSON facet `avg()` | **Translated** manual calculation | |
| 141 | +| `sum` | **Native** | **Translated** JSON facet `sum()` | **Translated** manual calculation | |
| 142 | +| `min` | **Native** | **Translated** JSON facet `min()` | **Translated** manual calculation | |
| 143 | +| `max` | **Native** | **Translated** JSON facet `max()` | **Translated** manual calculation | |
| 144 | +| `cardinality` | **Native** | **Translated** JSON facet `unique()` | **Translated** unique set count | |
| 145 | +| `value_count` | **Native** | **Translated** field statistics | **Translated** values count | |
| 146 | +| `stats` | **Native** | **Translated** field statistics | **Translated** manual calc (count/min/max/avg/sum) | |
| 147 | +| `extended_stats` | **Native** | **Translated** field statistics | **Translated** manual calc | |
| 148 | +| `percentiles` | **Native** | **Translated** field statistics | **Translated** sort + index lookup | |
| 149 | +| `percentile_ranks` | **Native** | **Translated** field statistics | **Translated** manual rank calc | |
| 150 | +| `top_hits` | **Native** | N/A (warn) | N/A | |
| 151 | +| `top_metrics` | **Native** | N/A (warn) | N/A | |
| 152 | +| `median_absolute_deviation` | **Native** | N/A (warn) | N/A | |
| 153 | +| `boxplot` | **Native** | N/A (warn) | N/A | |
| 154 | +| `string_stats` | **Native** | N/A (warn) | N/A | |
| 155 | +| `matrix_stats` | **Native** | N/A (warn) | N/A | |
| 156 | +| `t_test` | **Native** | N/A (warn) | N/A | |
| 157 | +| `rate` | **Native** | N/A (warn) | N/A | |
| 158 | +| `scripted_metric` | **Native** | N/A (warn) | N/A | |
| 159 | +| `geo_bounds` | **Native** | N/A (warn) | N/A | |
| 160 | +| `geo_centroid` | **Native** | N/A (warn) | N/A | |
| 161 | + |
| 162 | +--- |
| 163 | + |
| 164 | +## Request Features (29 fields) |
| 165 | + |
| 166 | +| Feature | Elasticsearch | Solr | Lucene | |
| 167 | +|---------|:------------:|:----:|:------:| |
| 168 | +| `from` / `size` | **Native** | **Translated** `start` / `rows` | **Translated** `hitsNeeded` offset | |
| 169 | +| `sort` | **Native** | **Translated** `SortClause` | **Translated** `SortField` | |
| 170 | +| `_source` | **Native** | **Translated** `fl` param | **Translated** field filter | |
| 171 | +| `highlight` | **Native** | **Translated** `hl.*` params | **Translated** `UnifiedHighlighter` | |
| 172 | +| `aggs` | **Native** | **Translated** facets / JSON facets | **Translated** manual aggregation | |
| 173 | +| `post_filter` | **Native** | **Translated** `fq` | **Translated** `BooleanQuery` FILTER | |
| 174 | +| `min_score` | **Native** | **Translated** `minScore` param | **Partial** (via query wrapping) | |
| 175 | +| `search_after` | **Native** | N/A | N/A | |
| 176 | +| `collapse` | **Native** | **Translated** `group=true` | N/A (warn) | |
| 177 | +| `suggest` | **Native** (term/phrase/completion) | **Partial** `spellcheck` | N/A (warn) | |
| 178 | +| `rescore` | **Native** | **Partial** `bq` (boost query) | N/A | |
| 179 | +| `timeout` | **Native** | **Translated** `timeAllowed` | N/A (warn) | |
| 180 | +| `explain` | **Native** | **Translated** `debugQuery` | N/A | |
| 181 | +| `script_fields` | **Native** | N/A | N/A | |
| 182 | +| `indices_boost` | **Native** | N/A | N/A | |
| 183 | +| `track_total_hits` | **Native** | Always tracks | Always tracks | |
| 184 | +| `stored_fields` | **Native** | **Translated** `fl` param | N/A | |
| 185 | +| `scroll` | **Native** | N/A | N/A | |
| 186 | +| `profile` | **Native** | N/A | N/A | |
| 187 | +| `pit` | **Native** | N/A | N/A | |
| 188 | +| `docvalue_fields` | **Native** | N/A | N/A | |
| 189 | +| `version` | **Native** | N/A | N/A | |
| 190 | +| `seq_no_primary_term` | **Native** | N/A | N/A | |
| 191 | +| `preference` | **Native** | N/A | N/A | |
| 192 | +| `routing` | **Native** | N/A | N/A | |
| 193 | +| `terminate_after` | **Native** | N/A | N/A | |
| 194 | +| `search_type` | Passed as param | N/A | N/A | |
| 195 | + |
| 196 | +--- |
| 197 | + |
| 198 | +## Response Fields |
| 199 | + |
| 200 | +| Field | Elasticsearch | Solr | Lucene | |
| 201 | +|-------|:------------:|:----:|:------:| |
| 202 | +| `took` | **Native** | **Translated** elapsed ms | **Translated** elapsed ms | |
| 203 | +| `timed_out` | **Native** | Always `false` | Always `false` | |
| 204 | +| `hits.total` | **Native** | **Translated** `numFound` | **Translated** `totalHits` | |
| 205 | +| `hits.max_score` | **Native** | **Translated** `maxScore` | **Translated** max from results | |
| 206 | +| `hits.hits._id` | **Native** | **Translated** `id` field | **Translated** `id` field | |
| 207 | +| `hits.hits._score` | **Native** | **Translated** `score` field | **Translated** `ScoreDoc.score` | |
| 208 | +| `hits.hits._source` | **Native** | **Translated** all fields | **Translated** stored fields | |
| 209 | +| `hits.hits.highlight` | **Native** | **Translated** `highlighting` | **Translated** `UnifiedHighlighter` | |
| 210 | +| `hits.hits._explanation` | **Native** | N/A | N/A | |
| 211 | +| `hits.hits.fields` | **Native** | N/A | N/A | |
| 212 | +| `hits.hits._version` | **Native** | N/A | N/A | |
| 213 | +| `hits.hits._seq_no` | **Native** | N/A | N/A | |
| 214 | +| `hits.hits.sort` | **Native** | N/A | N/A | |
| 215 | +| `aggregations` | **Native** | **Translated** facets | **Translated** manual aggs | |
| 216 | +| `suggest` | **Native** | N/A | N/A | |
| 217 | +| `_scroll_id` | **Native** | N/A | N/A | |
| 218 | +| `profile` | **Native** | N/A | N/A | |
| 219 | +| `_shards` | **Native** | N/A | N/A | |
| 220 | + |
| 221 | +--- |
| 222 | + |
| 223 | +## Coverage Summary |
| 224 | + |
| 225 | +| Category | Total | Elasticsearch | Solr | Lucene | |
| 226 | +|----------|:-----:|:------------:|:----:|:------:| |
| 227 | +| **Queries** | 40 | 40 (100%) | 40 (100%) | 40 (100%) | |
| 228 | +| **Aggregations** | 35 | 35 (100%) | 17 (49%) | 11 (31%) | |
| 229 | +| **Request Features** | 29 | 29 (100%) | 12 (41%) | 6 (21%) | |
| 230 | +| **Response Fields** | 18 | 18 (100%) | 8 (44%) | 8 (44%) | |
| 231 | + |
| 232 | +:::tip Recommendation |
| 233 | +For **full DSL compatibility**, use Elasticsearch as the search engine backend. Solr and Lucene provide excellent coverage for the most common queries and aggregations, with best-effort translations for advanced features. |
| 234 | +::: |
| 235 | + |
| 236 | +--- |
| 237 | + |
| 238 | +## Engine Selection Guide |
| 239 | + |
| 240 | +| Use Case | Recommended Engine | |
| 241 | +|----------|-------------------| |
| 242 | +| Full Elasticsearch DSL compatibility | **Elasticsearch** | |
| 243 | +| Production enterprise search with Solr infrastructure | **Solr** (covers 90%+ of common queries) | |
| 244 | +| Embedded search without external dependencies | **Lucene** (covers 90%+ of common queries) | |
| 245 | +| Vector / semantic search (knn) | **Elasticsearch** or **Lucene** (both native) | |
| 246 | +| Advanced aggregations (composite, nested, geo) | **Elasticsearch** | |
| 247 | +| Simple faceted search with metric aggs | **Solr** or **Lucene** | |
| 248 | + |
| 249 | +--- |
| 250 | + |
| 251 | +## See Also |
| 252 | + |
| 253 | +- [DSL Query API](./dsl-query.md) |
| 254 | +- [Search Engine Configuration](./search-engine.md) |
| 255 | +- [REST API Reference](./rest-api.md) |
0 commit comments