meilisearch v1.39.0 版本更新介绍
发布日期: 2026-03-16
版本号: v1.39.0
Meilisearch v1.39.0 主要更新如下:新增跨索引文档填充(
foreignKeys)功能,允许根据一个索引中的外键字段自动填充来自其他索引的相关文档,需先在实验性功能中启用该设置并配置索引间的关联关系;同时禁用了服务器发送事件(SSE)流式传输时的代理响应缓冲以改善实时响应。此外,修复了索引管道中的内存泄漏问题(该问题可能导致内存持续增长)以及任务删除过程中的潜在任务丢失和性能下降问题。其他更新包括忽略Windows平台上的不稳定测试、修正少量文档描述以及改进字段缺失时的错误提示。
更新内容 (中文)
变更内容
✨ 增强功能
🔬 跨索引文档数据填充
添加新的 ForeignKeys 设置,允许使用来自其他索引的文档来填充文档。
📓 注意:此实现不支持远程分片环境。
foreignKeys 实验性功能
一个新的实验性功能 foreignKeys 已添加到 /experimental-feature 路由,必须设置为 true 才能激活数据填充。
curl -X PATCH 'http://127.0.0.1:7700/experimental-features' \\
-H 'Content-Type: application/json' \\
--data-binary '{\"foreignKeys\": true}'
foreignKeys 索引设置
一个新的索引设置 foreignKeys 已添加到 /indexes/{index_uid}/settings:
// 新设置,允许索引之间多个外键关系的外键数组
\"foreignKeys\": [
{
// JSON 文档中包含外键文档 ID 的路径
\"fieldName\": \"actors\",
// 包含在数据填充期间要获取文档的外键索引的 UID
\"foreignIndexUid\": \"actors\"
}
]
示例
通过此新功能,结构如下的文档:
{
\"id\": 1,
\"title\": \"Forrest Gump\",
// 外键索引中的文档 ID
\"actors\": [
1
]
}
将在搜索响应中如下填充:
{
\"id\": 1,
\"title\": \"Forrest Gump\",
\"actors\": [
{
\"id\": 1,
\"name\": \"Tom\",
\"familyName\": \"Hanks\",
\"birthDate\": \"1956-07-09\"
}
]
}
由 @ManyTheFish 在 #6047 中贡献
在服务器发送事件(SSE)上禁用代理响应缓冲
当流模式激活时,在 POST /chats/{workspace_uid}/chat/completions 上添加 X-Accel-Buffering: no。
由 @YoEight 在 #6228 中贡献
🪲 错误修复
-
修复索引管道中的内存泄漏,由 @Kerollmops 在 #6212 中贡献
我们修复了由 bumpalo 无效使用引起的重要内存泄漏。如果你看到 Meilisearch 随时间使用越来越多内存,此问题在最新版本中不再可见。如果你想了解更多关于 bumpalo 陷阱的信息,这是一个很好的总结。看起来这个泄漏是在 v1.12 引入的,大约一年前…
-
通过在 wtxn 视图上应用增量来避免丢失任务,由 @Kerollmops 在 #6222 中贡献
我们解决了在 v1.38.1 引入的小性能回归,该问题影响了在任务删除期间向引擎发送更新。我们已将任务删除性能恢复到 v1.38.0 水平,并确保在删除期间仍允许更新时不会发生竞争条件。
🔩 其他事项
- 在 Windows 上忽略不稳定测试,由 @dureuill 在 #6226 中贡献
- 修复小文档错误,由 @ManyTheFish 在 #6205 中贡献
- 改进设置索引管道中字段缺失时的消息,由 @Kerollmops 在 #6213 中贡献
完整变更日志:https://github.com/meilisearch/meilisearch/compare/v1.38.0…v1.39.0
更新内容 (原始)
What’s Changed
✨ Enhancement
🔬 Cross-index document hydration
Add a new ForeignKeys setting allowing to hydrate documents with documents coming from other indexes.
📓 Note: This implementation doesn’t support a remote sharding environment
foreignKeys experimental feature
A new experimental feature, foreignKeys, has been added to the /experimental-feature route that must be set to true to activate the hydration.
curl -X PATCH 'http://127.0.0.1:7700/experimental-features' \
-H 'Content-Type: application/json' \
--data-binary '{"foreignKeys": true}'
foreignKeys index setting
A new index setting, foreignKeys, has been added to the /indexes/{index_uid}/settings:
// new setting, an array of foreign keys that allows multiple foreign relationships between indexes
"foreignKeys": [
{
// the path in the JSON document containing foreign document ids
"fieldName": "actors",
// the UID of the foreign index containing the documents to fetch during hydration
"foreignIndexUid": "actors"
}
]
Example
With this new feature, a document shaped as follows:
{
"id": 1,
"title": "Forrest Gump",
// Document IDs in foreign index
"actors": [
1
]
}
Will be hydrated as follows in a search response:
{
"id": 1,
"title": "Forrest Gump",
"actors": [
{
"id": 1,
"name": "Tom",
"familyName": "Hanks",
"birthDate": "1956-07-09"
}
]
}
By @ManyTheFish in #6047
Disable proxy response buffering on Server-Sent Events (SSE)
Add X-Accel-Buffering: no on POST /chats/{workspace_uid}/chat/completions when the streaming mode is activated.
By @YoEight in #6228
🪲 Bug fixes
-
Fix a memory leak in the indexation pipeline by @Kerollmops in #6212
We fixed an important memory leak caused by an invalid use of bumpalo. If you’ve seen Meilisearch using more and more memory over time, this issue is no longer visible in the latest version. If you want to read more about the bumpalo-trap we felt in, here is a good summary. It looks like this leak was introduced in v1.12, so approximately a year ago…
-
Avoid losing tasks by applying deltas on the wtxn view by @Kerollmops in #6222
We addressed a small performance regression introduced in v1.38.1 that affected sending updates to the engine during task deletion. We’ve restored the task deletion performance to match v1.38.0 levels and ensured no race conditions occur while still allowing updates during deletion.
🔩 Miscellaneous
- Ignore flaky test on windows by @dureuill in #6226
- Fix small documentation mistakes by @ManyTheFish in #6205
- Improve messaging when field is missing in the settings indexing pipeline by @Kerollmops in #6213
Full Changelog: https://github.com/meilisearch/meilisearch/compare/v1.38.0...v1.39.0
下载链接
- meilisearch-enterprise-linux-aarch64
- meilisearch-enterprise-linux-amd64
- meilisearch-enterprise-macos-amd64
- meilisearch-enterprise-macos-apple-silicon
- meilisearch-enterprise-windows-amd64.exe
- meilisearch-linux-aarch64
- meilisearch-linux-amd64
- meilisearch-macos-amd64
- meilisearch-macos-apple-silicon
- meilisearch-openapi.json
- meilisearch-windows-amd64.exe
- meilisearch.deb