Skip to content

Commit 8cedfc3

Browse files
dataroaringclaude
andcommitted
Add ES feature compatibility tables (VARIANT, search function)
Add VARIANT vs Dynamic Mapping and search() vs query_string comparison tables to ES migration docs (EN + ZH-CN), sourced from feature comparison document. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 779f059 commit 8cedfc3

File tree

2 files changed

+74
-0
lines changed

2 files changed

+74
-0
lines changed

docs/migration/elasticsearch-to-doris.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,43 @@ Doris's [Inverted Index](../table-design/index/inverted-index/overview.md) provi
9393
| `{"bool": {"should": [...]}}` | `WHERE ... OR ...` |
9494
| `{"exists": {"field": "email"}}` | `WHERE email IS NOT NULL` |
9595

96+
## Feature Compatibility
97+
98+
### VARIANT Type vs ES Dynamic Mapping
99+
100+
Doris [VARIANT](../data-operate/import/complex-types/variant.md) type provides comparable functionality to Elasticsearch Dynamic Mapping for flexible schema handling.
101+
102+
| Feature | Doris VARIANT | ES Dynamic Mapping | Status |
103+
|---------|--------------|-------------------|--------|
104+
| Dynamic schema inference | Auto-infer JSON field types | Dynamic Mapping | Compatible |
105+
| Predefined field types | `MATCH_NAME 'field': type` | Explicit Mapping | Compatible |
106+
| Pattern-based type matching | `MATCH_NAME_GLOB 'pattern*': type` | dynamic_templates | Compatible |
107+
| Field index configuration | `INDEX ... PROPERTIES("field_pattern"=...)` | Mapping + Index Settings | Compatible |
108+
| Custom analyzer | `CREATE INVERTED INDEX ANALYZER` | Custom Analyzer | Compatible |
109+
| Sub-column count limit | `variant_max_subcolumns_count` | `mapping.total_fields.limit` | Compatible |
110+
| Sparse column optimization | `variant_enable_typed_paths_to_sparse` | N/A | Doris-specific |
111+
| Nested array objects | Flattened handling | Nested Type | Partial |
112+
113+
### Search Function vs ES Query String
114+
115+
Doris `search()` function provides Lucene-compatible query string syntax similar to Elasticsearch `query_string`.
116+
117+
| Feature | Doris search() | ES query_string | Status |
118+
|---------|---------------|----------------|--------|
119+
| Query string syntax | Lucene mode | query_string query | Compatible |
120+
| Multi-field search | `fields` parameter | multi_match / fields | Supported |
121+
| best_fields mode | Supported | Supported | Supported |
122+
| cross_fields mode | Supported | Supported | Supported |
123+
| VARIANT sub-column search | `variant.field:term` | Object/Nested search | Supported |
124+
| Boolean queries | AND/OR/NOT | AND/OR/NOT | Supported |
125+
| Phrase queries | `"exact phrase"` | `"exact phrase"` | Supported |
126+
| Wildcards | `*`, `?` | `*`, `?` | Supported |
127+
| Regular expressions | `/pattern/` | `/pattern/` | Supported |
128+
| Relevance scoring | Disabled | BM25 | Not supported |
129+
| Fuzzy queries | Not supported | `term~2` | Not supported |
130+
| Range queries | Not supported | `[a TO z]` | Not supported |
131+
| Proximity queries | Not supported | `"foo bar"~5` | Not supported |
132+
96133
## Next Steps
97134

98135
- [Inverted Index](../table-design/index/inverted-index/overview.md) - Full-text search in Doris

i18n/zh-CN/docusaurus-plugin-content-docs/current/migration/elasticsearch-to-doris.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,43 @@ Doris 的[倒排索引](../table-design/index/inverted-index/overview.md)提供
9393
| `{"bool": {"should": [...]}}` | `WHERE ... OR ...` |
9494
| `{"exists": {"field": "email"}}` | `WHERE email IS NOT NULL` |
9595

96+
## 功能兼容性
97+
98+
### VARIANT 类型与 ES Dynamic Mapping 对比
99+
100+
Doris [VARIANT](../data-operate/import/complex-types/variant.md) 类型提供与 Elasticsearch Dynamic Mapping 相当的灵活 Schema 处理功能。
101+
102+
| 功能 | Doris VARIANT | ES Dynamic Mapping | 状态 |
103+
|------|--------------|-------------------|------|
104+
| 动态 Schema 推断 | 自动推断 JSON 字段类型 | Dynamic Mapping | 对齐 |
105+
| 预定义字段类型 | `MATCH_NAME 'field': type` | Explicit Mapping | 对齐 |
106+
| 模式匹配指定类型 | `MATCH_NAME_GLOB 'pattern*': type` | dynamic_templates | 对齐 |
107+
| 字段索引配置 | `INDEX ... PROPERTIES("field_pattern"=...)` | Mapping + Index Settings | 对齐 |
108+
| 自定义分析器 | `CREATE INVERTED INDEX ANALYZER` | Custom Analyzer | 对齐 |
109+
| 子列数量限制 | `variant_max_subcolumns_count` | `mapping.total_fields.limit` | 对齐 |
110+
| 稀疏列优化 | `variant_enable_typed_paths_to_sparse` | N/A | Doris 特有 |
111+
| Nested 数组对象 | 扁平化处理 | Nested Type | 部分支持 |
112+
113+
### Search 函数与 ES Query String 对比
114+
115+
Doris `search()` 函数提供与 Elasticsearch `query_string` 兼容的 Lucene 查询字符串语法。
116+
117+
| 功能 | Doris search() | ES query_string | 状态 |
118+
|------|---------------|----------------|------|
119+
| Query String 语法 | Lucene mode | query_string query | 兼容 |
120+
| 多字段搜索 | `fields` 参数 | multi_match / fields | 支持 |
121+
| best_fields 模式 | 支持 | 支持 | 支持 |
122+
| cross_fields 模式 | 支持 | 支持 | 支持 |
123+
| VARIANT 子列搜索 | `variant.field:term` | Object/Nested 搜索 | 支持 |
124+
| 布尔查询 | AND/OR/NOT | AND/OR/NOT | 支持 |
125+
| 短语查询 | `"exact phrase"` | `"exact phrase"` | 支持 |
126+
| 通配符 | `*`, `?` | `*`, `?` | 支持 |
127+
| 正则表达式 | `/pattern/` | `/pattern/` | 支持 |
128+
| 评分排序 | 已禁用 | BM25 | 不支持 |
129+
| 模糊查询 | 不支持 | `term~2` | 不支持 |
130+
| 范围查询 | 不支持 | `[a TO z]` | 不支持 |
131+
| 近似查询 | 不支持 | `"foo bar"~5` | 不支持 |
132+
96133
## 下一步
97134

98135
- [倒排索引](../table-design/index/inverted-index/overview.md) - Doris 中的全文搜索

0 commit comments

Comments
 (0)