发布日期: 2026-02-02
版本号: v1.35.0

Meilisearch v1.35.0 版本主要包含以下更新:新增了搜索性能观察功能,在搜索请求中设置showPerformanceDetailstrue后,响应中会返回详细的性能耗时信息,帮助用户理解查询耗时原因;同时,针对POST /indexes/<index_uid>/fields路由进行了破坏性更改,其返回结果从数组变为包含resultsoffsetlimittotal字段的对象;此外,该版本还稳定了多线程处理分面和前缀的功能以提升索引速度,并修复了其他一些问题。

更新内容 (中文)

Meilisearch v1.35.0 包含对搜索性能可观测性的改进、对最近引入的 POST /indexes/<index_uid>/fields 路由的破坏性变更,以及其他错误修复和改进。

🌈 改进

观测搜索性能

搜索路由接受一个名为 showPerformanceDetails 的新字段。当设置为 true 时,搜索响应将包含一个性能跟踪,使用户能更好地理解搜索查询中耗时的部分。

受影响的路由:

  • POST /indexes/<index_uid>/search
  • GET /indexes/<index_uid>/search
  • POST /multi-search
  • POST /indexes/<index_uid>/similar
  • GET /indexes/<index_uid>/similar

搜索

路由:POST /indexes/<index_uid>/searchGET /indexes/<index_uid>/search

请求

新的请求参数:

  • showPerformanceDetailstrue/false(布尔值)
示例
{
	"q": "glass",
	"showPerformanceDetails": true
}

响应

新的响应字段:

  • performanceDetails{"<span>": "<human_duration>", .. }(映射)
示例
{
	"hits": [
		// 命中结果 ..
	],
	"query": "glass",
	"processingTimeMs": 5,
	"limit": 20,
	"offset": 0,
	"estimatedTotalHits": 1,
	"requestUid": "<uuid>",
	"performanceDetails": {
		"wait for permit": "295.29µs",
		"search > tokenize": "436.67µs",
		"search > resolve universe": "649.00µs",
		"search > keyword search": "515.71µs",
		"search > format": "288.54µs",
		"search": "3.56ms"
	}
}

多搜索

路由:POST /multi-search

请求

新的请求参数:

  • queries.showPerformanceDetailstrue/false(布尔值)
示例
"queries": [
	{
		"indexUid": "<index_uid>",
		"q": "glass",
		"showPerformanceDetails": true
	}
]

响应

新的响应字段:

  • results.performanceDetails{"<span>": "<human_duration>", .. }(映射)
示例
{
	"results": [
		{
			"indexUid": "<index_uid>",
			"hits": [
				// 命中结果 ..
			],
			"query": "glass",
			"processingTimeMs": 5,
			"limit": 20,
			"offset": 0,
			"estimatedTotalHits": 1,
			"requestUid": "<uuid>",
			"performanceDetails": {
				"wait for permit": "295.29µs",
				"search > tokenize": "436.67µs",
				"search > resolve universe": "649.00µs",
				"search > keyword search": "515.71µs",
				"search > format": "288.54µs",
				"search": "3.56ms"
			}
		}
	]
}

联邦搜索

路由:POST /multi-search

请求

新的请求参数:

  • federation.showPerformanceDetailstrue/false(布尔值)
示例
{
	"federation": { "showPerformanceDetails": true },
	"queries": [
		{
			"indexUid": "<index_uid>",
			"q": "glass"
		}
	]
}

响应

新的响应字段:

  • performanceDetails{"<span>": "<human_duration>", .. }(映射)
示例
{
	"hits": [
		// 命中结果 ..
	],
	"query": "glass",
	"processingTimeMs": 5,
	"limit": 20,
	"offset": 0,
	"estimatedTotalHits": 1,
	"requestUid": "<uuid>",
	"performanceDetails": {
		"wait for permit": "213.83µs",
		"search > tokenize": "171.67µs",
		"search > resolve universe": "257.63µs",
		"search > keyword search": "577.71µs",
		"search > format": "114.96µs",
		"search > federation > wait for remote results": "62.71µs",
		"search > federation > merge results": "120.04µs",
		"search > federation > merge facets": "53.42µs",
		"search > federation": "237.04µs",
		"search": "289.08ms"
	}
}

相似项

路由:POST /indexes/<index_uid>/similarGET /indexes/<index_uid>/similar

请求

新的请求参数:

  • showPerformanceDetailstrue/false(布尔值)
示例
{
	"id": 143,
	"embedder": "manual",
	"showPerformanceDetails": true
}

响应

新的响应字段:

  • performanceDetails{"<span>": "<human_duration>", .. }(映射)
示例
{
	"hits": [
		// 命中结果 ..
	],
	"id": "143",
	"processingTimeMs": "[duration]",
	"limit": 20,
	"offset": 0,
	"estimatedTotalHits": 4,
	"performanceDetails": {
		"search > format": "244.92µs",
		"search": "1.25ms"
	}
}

由 @ManyTheFish 在 https://github.com/meilisearch/meilisearch/pull/6132 提交

稳定化 Facets 和前缀的多线程后处理

Facets 和前缀的多线程后处理可加速多核机器上的索引。

在 v1.35.0 之前,它可以通过一个实验性功能禁用。

Meilisearch v1.35.0 移除了该实验性功能,导致多线程后处理始终启用。

升级到 v1.35.0 的云用户将受益于该加速。

由 @ManyTheFish 在 https://github.com/meilisearch/meilisearch/pull/6130 提交

🦋 修复

破坏性变更:在 POST /indexes/<index_uid>/fields 路由中返回分页字段

[!WARNING] 破坏性变更POST /indexes/<index_uid>/fields 路由现在返回一个包含 resultsoffsetlimittotal 字段的对象,而不是返回结果数组。此更改允许了解有多少字段匹配给定的过滤器。

示例:变更前/后

变更前:

[
  // 字段 ..
]

变更后:

{
  "results": [
    // [字段 .. ]
  ],
  "offset": 0,
  "limit": 20,
  "total": 0
}

由 @ManyTheFish 在 https://github.com/meilisearch/meilisearch/pull/6126 提交

POST /indexes/<index_uid>/fields:修复当父字段匹配子模式时(如 title 匹配模式 title.to*)的模式过滤问题。

示例:变更前/后

对于以下请求:

{
  "filter": {
    "attributePatterns": [
      "title.en"
    ]
  }
}

变更前响应,返回 title 字段:

{
  "results": [
    {
      "name": "title",
      // 元数据...
    },
    
  ],
  "offset": 0,
  "limit": 20,
  "total": 1
}

变更后响应,不返回任何内容:

{
  "results": [],
  "offset": 0,
  "limit": 20,
  "total": 0
}

由 @ManyTheFish 提交,同样见 https://github.com/meilisearch/meilisearch/pull/6126

🐛 其他修复

🔩 杂项

新贡献者

完整变更日志:https://github.com/meilisearch/meilisearch/compare/v1.34.3…v1.35.0

更新内容 (原始)

Meilisearch v1.35.0 contains improvements to the observability of the search performance, a breaking change to the recently introduced POST /indexes/<index_uid>/fields route, and other bugfixes and improvements.

🌈 Improvements

Observe the search performance

The search routes accept a new field named showPerformanceDetails. When set to true, the search response contains a performance trace, allowing the user to better understand what takes time during a search query.

impacted routes:

  • POST /indexes/<index_uid>/search
  • GET /indexes/<index_uid>/search
  • POST /multi-search
  • POST /indexes/<index_uid>/similar
  • GET /indexes/<index_uid>/similar

routes: POST /indexes/<index_uid>/search and GET /indexes/<index_uid>/search

Request

new request parameters:

  • showPerformanceDetails: true/false (boolean)
example
{
	"q": "glass",
	"showPerformanceDetails": true
}

Response

new response field:

  • performanceDetails: {"<span>": "<human_duration>", .. } (map)
example
{
	"hits": [
		// hits ..
	],
	"query": "glass",
	"processingTimeMs": 5,
	"limit": 20,
	"offset": 0,
	"estimatedTotalHits": 1,
	"requestUid": "<uuid>",
	"performanceDetails": {
		"wait for permit": "295.29µs",
		"search > tokenize": "436.67µs",
		"search > resolve universe": "649.00µs",
		"search > keyword search": "515.71µs",
		"search > format": "288.54µs",
		"search": "3.56ms"
	}
}

route: POST /multi-search

Request

new request parameters:

  • queries.showPerformanceDetails: true/false (boolean)
example
"queries": [
	{
		"indexUid": "<index_uid>",
		"q": "glass",
		"showPerformanceDetails": true
	}
]

Response

new response field:

  • results.performanceDetails: {"<span>": "<human_duration>", .. } (map)
example
{
	"results": [
		{
			"indexUid": "<index_uid>",
			"hits": [
				// hits ..
			],
			"query": "glass",
			"processingTimeMs": 5,
			"limit": 20,
			"offset": 0,
			"estimatedTotalHits": 1,
			"requestUid": "<uuid>",
			"performanceDetails": {
				"wait for permit": "295.29µs",
				"search > tokenize": "436.67µs",
				"search > resolve universe": "649.00µs",
				"search > keyword search": "515.71µs",
				"search > format": "288.54µs",
				"search": "3.56ms"
			}
		}
	]
}

route: POST /multi-search

Request

new request parameters:

  • federation.showPerformanceDetails: true/false (boolean)
example
{
	"federation": { "showPerformanceDetails": true },
	"queries": [
		{
			"indexUid": "<index_uid>",
			"q": "glass"
		}
	]
}

Response

new response field:

  • performanceDetails: {"<span>": "<human_duration>", .. } (map)
example
{
	"hits": [
		// hits ..
	],
	"query": "glass",
	"processingTimeMs": 5,
	"limit": 20,
	"offset": 0,
	"estimatedTotalHits": 1,
	"requestUid": "<uuid>",
	"performanceDetails": {
		"wait for permit": "213.83µs",
		"search > tokenize": "171.67µs",
		"search > resolve universe": "257.63µs",
		"search > keyword search": "577.71µs",
		"search > format": "114.96µs",
		"search > federation > wait for remote results": "62.71µs",
		"search > federation > merge results": "120.04µs",
		"search > federation > merge facets": "53.42µs",
		"search > federation": "237.04µs",
		"search": "289.08ms"
	}
}

Similar

routes: POST /indexes/<index_uid>/similar and GET /indexes/<index_uid>/similar

Request

new request parameters:

  • showPerformanceDetails: true/false (boolean)
example
{
	"id": 143,
	"embedder": "manual",
	"showPerformanceDetails": true
}

Response

new response field:

  • performanceDetails: {"<span>": "<human_duration>", .. } (map)
example
{
	"hits": [
		// hits ..
	],
	"id": "143",
	"processingTimeMs": "[duration]",
	"limit": 20,
	"offset": 0,
	"estimatedTotalHits": 4,
	"performanceDetails": {
		"search > format": "244.92µs",
		"search": "1.25ms"
	}
}

By @ManyTheFish in https://github.com/meilisearch/meilisearch/pull/6132

Stabilize multithreaded post-processing of facets and prefixes

Multithreaded post-processing of facets and prefixes speeds-up indexing on multi-core machines.

Before v1.35.0, it could be disabled with an experimental feature.

Meilisearch v1.35.0 removes that experimental feature, resulting in the multithreaded post-processing being always enabled.

Cloud users upgrading to v1.35.0 will benefit from the speed-up.

By @ManyTheFish in https://github.com/meilisearch/meilisearch/pull/6130

🦋 Fixes

Breaking change: return pagination fields in POST /indexes/<index_uid>/fields route

[!WARNING] Breaking change: The POST /indexes/<index_uid>/fields route now returns an object containing the results, offset, limit, and total fields instead of returning an array of results. This change allows to know how many fields match a given filter

Example: before/after

Before:

[
  // fields ..
]

After:

{
  "results": [
    // [fields .. ]
  ],
  "offset": 0,
  "limit": 20,
  "total": 0
}

By @ManyTheFish in https://github.com/meilisearch/meilisearch/pull/6126

POST /indexes/<index_uid>/fields: Fix pattern filtering when a parent field was matching a child pattern: title was matching the pattern title.to*.

Example: before/after

For the following request:

{
  "filter": {
    "attributePatterns": [
      "title.en"
    ]
  }
}

Before Response, title field is returned:

{
  "results": [
    {
      "name": "title",
      //metadata...
    },
    
  ],
  "offset": 0,
  "limit": 20,
  "total": 1
}

After Response, nothing returned:

{
  "results": [],
  "offset": 0,
  "limit": 20,
  "total": 0
}

By @ManyTheFish, also in https://github.com/meilisearch/meilisearch/pull/6126

🐛 Other fixes

🔩 Miscellaneous

New Contributors

Full Changelog: https://github.com/meilisearch/meilisearch/compare/v1.34.3...v1.35.0

下载链接