# Manticore Search 7.0.0: Smarter Search, Real-Time Syncing, and Enhanced Performance

Manticore Search 7.0.0 introduces fuzzy search, query suggestions, Kafka integration, scroll pagination, Chinese tokenization, and 60+ improvements

我们非常高兴地宣布 **Manticore Search 7.0.0** 的发布，其中包含突破性功能、性能优化和关键改进，以提升您的搜索体验。从模糊搜索功能到无缝的 Kafka 集成，此次发布使开发人员能够构建更快、更可靠且更用户友好的应用程序。

---

### 🚨 重要升级说明

在深入新功能之前，请查看这些 **重大变更**：

1. **按表 Binlog** ([#879](https://github.com/manticoresoftware/manticoresearch/issues/879))：升级前请执行 **干净关闭**。
2. **复制协议更新** ([#1789](https://github.com/manticoresoftware/manticoresearch/issues/1789), [#2308](https://github.com/manticoresoftware/manticoresearch/issues/2308))：遵循 [集群重启指南](https://manual.manticoresearch.com/Creating_a_cluster/Setting_up_replication/Restarting_a_cluster#Restarting-a-cluster) 以避免停机时间。
3. **主/代理协议更新** ([#2468](https://github.com/manticoresoftware/manticoresearch/issues/2468))：如果您在分布式环境中运行 Manticore Search 并有多个实例，请确保首先升级代理，然后升级主节点。

如需完整详情和更多重大变更，请参阅 [变更日志](https://manual.manticoresearch.com/Changelog#Version-7.0.0)。

---

### 🔍 模糊搜索与自动补全
告别拼写错误！新的 **[模糊搜索](https://manual.manticoresearch.com/Searching/Spell_correction#Fuzzy-Search)** 通过匹配相似术语来处理拼写错误，而 **[自动补全](https://manual.manticoresearch.com/Searching/Autocomplete#CALL-AUTOCOMPLETE)** 可实时预测查询。非常适合电子商务和动态搜索栏。

```sql
mysql> call autocomplete('gra', 'test');
+-----------+
| query     |
+-----------+
| gradually |
| grow      |
| grew      |
| angry     |
| draw      |
| hungry    |
| brave     |
+-----------+
```

```sql
mysql> SELECT * FROM mytable WHERE MATCH('someting') OPTION fuzzy=1, layouts='us,ua', distance=2;
+------+-------------+
| id   | content     |
+------+-------------+
|    1 | something   |
|    2 | some thing  |
+------+-------------+
2 rows in set (0.00 sec)
```

这两个新功能也可通过 JSON 接口访问。

### 滚动分页 ([#2811](https://github.com/manticoresoftware/manticoresearch/issues/2811))
使用 **[滚动](https://manual.manticoresearch.com/Searching/Pagination#Scroll-Search-Option)** 选项高效浏览大型数据集，适合深度分页而不会影响性能。

```sql
SELECT weight(), id FROM test WHERE match('hello') limit 20
OPTION scroll='eyJvcmRlcl9ieV9zdHIiOiJ3ZWlnaHQoKSBkZXNjLCBpZCBhc2MiLCJvcmRlcl9ieSI6W3siYXR0ciI6IndlaWdodCgpIiwiZGVzYyI6dHJ1ZSwidmFsdWUiOjEyODEsInR5cGUiOiJpbnQifSx7ImF0dHIiOiJpZCIsImRlc2MiOmZhbHNlLCJ2YWx1ZSI6MiwidHlwZSI6ImludCJ9XX0=';
```

---

### ⚡ 从 Kafka 实时同步数据

通过 **[Kafka](https://manual.manticoresearch.com/Integration/Kafka#Syncing-from-Kafka)** 无缝同步数据。实时将流数据摄入 Manticore，使日志、指标或用户生成内容立即可搜索。

```sql
CREATE SOURCE kafka
(id bigint, term text, abbrev '$abbrev' text, GlossDef json)
type='kafka'
broker_list='kafka:9092'
topic_list='my-data'
consumer_group='manticore'
num_consumers='2'
batch=50

CREATE TABLE destination_kafka
(id bigint, name text, short_name text, received_at text, size multi);

CREATE MATERIALIZED VIEW view_table
TO destination_kafka AS
SELECT id, term as name, abbrev as short_name, UTC_TIMESTAMP() as received_at, GlossDef.size as size FROM kafka
```

---

### 📊 性能：JSON 的二级索引 ([#1928](https://github.com/manticoresoftware/manticoresearch/issues/1928))
使用 **[JSON 的二级索引](https://manual.manticoresearch.com/Creating_a_table/Local_tables/Plain_and_real-time_table_settings#json_secondary_indexes)** 加速按 JSON 属性过滤的查询。

```sql
ALTER TABLE users ADD COLUMN profile JSON;
ALTER TABLE users ADD secondary_index profile_json ON (profile);
```

还有一个新命令 [SHOW TABLE INDEXES](https://manual.manticoresearch.com/Node_info_and_management/Table_settings_and_status/SHOW_TABLE_INDEXES) 用于检查索引：
```sql
mysql> SHOW TABLE test INDEXES;
+------------------------------+--------+---------+---------+
| Name                         | Type   | Enabled | Percent |
+------------------------------+--------+---------+---------+
| j['addresses']               | uint32 | 1       | 100     |
| j['addresses']['a1']         | uint32 | 1       | 100     |
| j['addresses']['a2']         | uint32 | 1       | 100     |
| j['factor']                  | uint32 | 1       | 100     |
| j['int_arr']                 | uint32 | 1       | 100     |
| j['tags']                    | uint32 | 1       | 100     |
| id                           | int64  | 1       | 100     |
| j['price']                   | float  | 1       | 100     |
| j['addresses']['a1']['id']   | string | 1       | 100     |
| j['addresses']['a1']['name'] | string | 1       | 100     |
| j['addresses']['a2']['id']   | string | 1       | 100     |
| j['addresses']['a2']['name'] | string | 1       | 100     |
| j['arr']                     | string | 1       | 100     |
| j['str']                     | string | 1       | 100     |
| j['tags']['1']               | string | 1       | 100     |
| j['tags']['2']               | string | 1       | 100     |
+------------------------------+--------+---------+---------+
16 rows in set (0.00 sec)
```

---

### 📊 性能：非阻塞更新与合并 ([#2361](https://github.com/manticoresoftware/manticoresearch/issues/2361))
在磁盘块合并期间不再有查询延迟！更新和搜索现在在磁盘块优化时可以不间断运行。

---

### 📊 性能：RT 表的自动磁盘块刷新 ([#2787](https://github.com/manticoresoftware/manticoresearch/issues/2787))

现在，Manticore 会自动将 RAM 块刷新到磁盘块，防止由于 RAM 块缺乏优化而导致的性能问题，这有时会根据块大小导致不稳定。

您可以使用 [diskchunk_flush_write_timeout](https://manual.manticoresearch.com/Server_settings/Searchd#diskchunk_flush_write_timeout) 设置按表或整个表控制此功能。

---

### 🌍 Jieba 中文分词 ([#931](https://github.com/manticoresoftware/manticoresearch/issues/931))
通过 **[Jieba 集成](https://manual.manticoresearch.com/Creating_a_table/NLP_and_tokenization/Languages_with_continuous_scripts#Chinese-Tokenization)** 实现精确的中文文本分析。

```sql
CREATE TABLE products(title text, price float) charset_table = 'cont' morphology = 'jieba_chinese'
```

---

### 还有更多
上述更新只是 Manticore 7.0.0 中包含的众多改进的一部分。请阅读：

🚀 7 项重大变更
✅ 49 项次要变更
🐞 63 个错误修复

在 [变更日志](https://manual.manticoresearch.com/Changelog) 中。

---

## 🚀 立即开始
升级到 **Manticore Search 7.0.0** 以利用这些强大的新功能。如需完整的变更列表，请访问 [变更日志](https://manual.manticoresearch.com/Changelog)。

**我们很乐意听到您的反馈！**
- 在我们的 [社区论坛](https://forum.manticoresearch.com) 上参与讨论
- 在 [GitHub](https://github.com/manticoresoftware/manticoresearch/issues) 上报告问题或提出功能建议
- 在 [Slack](https://slack.manticoresearch.com) 上与我们聊天
* 直接通过 `contact@manticoresearch.com` 邮件联系我们

*特别感谢贡献者 [@subnix](https://github.com/subnix), [@animetosho](https://github.com/animetosho), Alexey Ivanov 和所有帮助塑造此次发布的人！* ❤️
