发布日期: 2026-09-21
版本号: v1.54.0

Meilisearch v1.54.0 破坏性变更说明:对 experimental 功能 dynamicSearchRules 做了不兼容调整,云用户和使用 –upgrade-db 升级的用户规则会自动迁移,UI 也会适配新 API,只有直接通过 API 获取规则的用户会受第一处变更影响。POST /dynamic-search-rules 接口的 actions 字段从列表改为包含两个字段的对象:pin 是置顶操作数组,每项含必填的文档 id 和置顶位置 position,以及可选的 indexUid,为 null 或缺失时对所有包含该文档的索引生效;scale 是缩放操作数组,每项含必填的缩放权重 weight,以及可选的文档 id 列表 ids、索引过滤条件 filter 和 indexUid。PATCH /dynamic-search-rule 接口同样要求按新格式传入修改后的 actions 字段,且保留 uid __meilisearch_metadata 不可用作 ruleUid。功能增强方面,新增 scale 动作支持通过搜索规则提升、降低或隐藏文档:权重大于 1 提升排序,小于 1 降低排序,等于 0 则隐藏(除非同时被置顶);但该因子作用于相关性排序规则,若首个排序规则不是相关性规则则效果不明显。置顶文档的评分详情新增 ruleUid 字段标识触发置顶的规则,缩放文档的评分详情新增 scale 字段(order 恒为 0),包含各规则的 ruleUid 和 weight 以及总乘积 totalWeight;注意用户可通过评分详情看到规则 uid,敏感信息应写在规则描述中。同时新增两个环境变量控制缩放规模:MEILI_EXPERIMENTAL_DSR_FUEL_MAX_SCALE_ACTIONS 限制单次搜索可用的缩放动作数(1-255,默认 10),MEILI_EXPERIMENTAL_DSR_FUEL_SCALE_FUEL 限制单次搜索评估的缩放约束组合数(1-255,默认 10)。文档还给出了节日期间提升蝙蝠侠商品、降权缺货商品、隐藏停产商品三个配置示例。其他改进:新增 /mcp 路径的 MCP 协议端点,实现 HTTP+SSE 传输,可注册到 Claude Code、Codex 等 LLM,使用 bearer 认证且不支持 OAuth,需启用 mcpRoute 实验功能;联邦搜索的性能详情现在按查询分别统计耗时。杂项包括移除索引器中的 HashMap transmute、升级 lru 到 0.18.4、Rust 升级到 1.98.1 并简化安装、升级多数依赖、actions/setup-go 升级到 7.0.0、修正错误码描述的语法和失效 Markdown 链接、修正一个错别字,并新增一位贡献者。完整变更可对比 v1.53.2 与 v1.54.0。

更新内容 (中文)

💥 破坏性变更

Meilisearch v1.54.0 对 dynamicSearchRules 实验性功能进行了破坏性变更。

  • 对于 Cloud 用户,规则将自动迁移,UI 也会适配新 API。只有规则列表(rulelist)上的第一处变更可能会直接影响通过 API 获取规则的用户。
  • 使用 --upgrade-db 升级时,规则将自动迁移。
  1. POST /dynamic-search-rules 端点现在返回的 actions 是一个包含 2 个字段的对象,而不再是列表:

    1. pin 是一个 Pin 对象数组,包含以下字段:
      1. id,字符串,必填:要置顶的文档的 id
      2. position:正数或零,必填:文档置顶的位置
      3. indexUid,可选,默认为 null:此操作所应用的索引的 uid。若为 null 或缺失,则该操作适用于任何包含所提供 id 文档的索引。
    2. scale 是一个 Scale 对象数组,包含以下字段:
      1. weight,正数或零,必填:与所选文档固有相关性分数相乘的缩放系数
      2. ids,字符串数组,可选:需要按所提供权重缩放其相关性分数的文档 id 列表
      3. filter:不含 foreign filter 的 Meilisearch filter,可选:对索引施加的过滤器,用于解析并确定所选文档列表
      4. indexUid,可选,默认为 null:此操作所应用的索引的 uid。若为 null 或缺失,则该操作适用于任何索引。
  2. PATCH /dynamic-search-rules/{:ruleUid} 端点现在要求传入带有修改后 actions 字段的规则。详情参见 POST /dynamic-search-rules 的变更。

  3. uid __meilisearch_metadata 现已保留,不能在 PATCH /dynamic-search-rules/{:ruleUid} 中用作 ruleUid。

🌈 改进

使用搜索规则提升、降权和隐藏文档

  • 动态搜索规则现在可以通过定义新的 “scale” 操作来提升、降权或隐藏文档:该操作通过 filter 和/或显式 id 列表选择某些文档,并以 weight 形式暴露缩放系数:
    • 若 weight > 1.0,则所选文档被提升
    • 若 weight < 1.0,则所选文档被降权(demoted)
    • 若 weight = 0.0,则所选文档被隐藏,不会出现在搜索结果中(除非它们同时被置顶)
    • ⚠️ 由于该系数作用于相关性规则,当第一个排序规则不是相关性规则时,其可测量的效果很小。
  • 被置顶文档的评分详情(score details)现在包含一个额外的 ruleUid 字段,指示导致该文档被置顶的规则名称。⚠️ 因此,终端用户可以通过查看排序评分详情得知所应用规则的 uid。请将任何敏感信息放在规则的描述中 ⚠️
  • 被缩放文档的评分详情现在包含一个额外的 scale 字段,其 order 为 0。scale 字段是一个对象,包含以下字段:
    • order:规则的应用顺序。始终为 0
    • actions:ScaleAction 数组,每个 ScaleAction 包含以下字段:
      • ruleUid:所应用规则的名称
      • weight:所应用规则的权重
    • totalWeight:计算得出的总乘法系数,等于各个 .actions[].weight 的乘积。
  • 新增控制 scale 操作发生量的环境变量:
    • MEILI_EXPERIMENTAL_DSR_FUEL_MAX_SCALE_ACTIONS:单次搜索中可应用(至少命中一个所选文档)的 scale 操作的最大数量。范围 1-255,默认 10
    • MEILI_EXPERIMENTAL_DSR_FUEL_SCALE_FUEL:单次搜索中评估的 scale 约束组合的最大数量。范围 1-255,默认 10。

示例

为某个节日提升 "Batman" 商品
  1. 创建搜索规则
// PATCH /dynamic-search-rule/batman-festival

{
  "conditions": {
    "time": {
      "start": "2026-09-21T19:00:00Z",
      "end": "2026-09-28T18:59:00Z"
    },
  },
  "actions": {
    "scale": [
      {
        "filter": "series = batman",
        "weight": 4.0
      }
    ]
  }
}
  1. 待 DSR 更新任务处理完成、节日于 9 月 21 日开始后,执行搜索查询:
{
  "q": "superhero returns prequel",
  "showRankingScoreDetails": true
}
  1. 观察文档的排序结果

"hits": [
        {
          "id": "batman-returns",
          "title": "Batman Returns",
          "series": "batman",
          "_rankingScore": 0.30808080808080807,
          "_rankingScoreDetails": {
            "scale": {
              "order": 0,
              "actions": [
                {
                  "ruleUid": "batman-festival",
                  "weight": 4.0
                }
              ],
              "totalWeight": 4.0
            },
            "words": {
              "order": 1,
              "matchingWords": 1,
              "maxMatchingWords": 3,
              "score": 0.3333333333333333
            },
            "typo": {
              "order": 2,
              "typoCount": 0,
              "maxTypoCount": 1,
              "score": 1.0
            },
            "proximity": {
              "order": 3,
              "score": 1.0
            },
            "attributeRank": {
              "order": 4,
              "score": 1.0
            },
            "wordPosition": {
              "order": 5,
              "score": 0.9090909090909092
            },
            "exactness": {
              "order": 6,
              "matchType": "noExactMatch",
              "matchingWords": 1,
              "maxMatchingWords": 1,
              "score": 0.3333333333333333
            }
          }
        },
        {
          "id": "superman-returns",
          "series": "superman",
          "title": "Superman Returns - The Prequels",
          "_rankingScore": 0.9628456221198156,
          "_rankingScoreDetails": {
            "words": {
              "order": 0,
              "matchingWords": 3,
              "maxMatchingWords": 3,
              "score": 1.0
            },
            "typo": {
              "order": 1,
              "typoCount": 0,
              "maxTypoCount": 3,
              "score": 1.0
            },
            "proximity": {
              "order": 2,
              "score": 0.5714285714285714
            },
            "attributeRank": {
              "order": 3,
              "score": 1.0
            },
            "wordPosition": {
              "order": 4,
              "score": 0.9032258064516128
            },
            "exactness": {
              "order": 5,
              "matchType": "noExactMatch",
              "matchingWords": 2,
              "maxMatchingWords": 3,
              "score": 0.25
            }
          }
        },
        // ...
      ],
      "processingTimeMs": "[duration]",
      "limit": 20,
      "offset": 0,
      "estimatedTotalHits": 42,
      "requestUid": "[uuid]"
    }
降权缺货商品
// PATCH /dynamic-search-rules/out-of-stock

{
  "actions": {
    "scale": [
      {
        "filter": "availability = \"out of stock\"",
        "weight": 0.5
      }
    ]
  }
}
隐藏停产商品
// PATCH /dynamic-search-rules/discontinued

{
  "actions": {
    "scale": [
      {
        "filter": "availability = discontinued",
        "weight": 0.0
      }
    ]
  }
}

By @dureuill in https://github.com/meilisearch/meilisearch/pull/6549

MCP 端点

我们在 /mcp 路径上引入了新的 MCP 协议。它实现了该协议的 HTTP+SSE 传输版本。你可以将 Meilisearch MCP 注册到你喜爱的 LLM 中,例如 Claude Code、Codex。注意 MCP 路由使用 bearer 认证,不支持 OAuth 认证。

启用 mcpRoute 实验性功能后即可使用该功能。

by @Kerollmops in https://github.com/meilisearch/meilisearch/pull/6629

改进多搜索中的搜索性能详情

联邦搜索中的性能详情现在按查询分别列出耗时

示例
"performanceDetails": {
  "wait in queue": "1.36ms",
  "preprocess filters > prepare": "985.00µs",
  "preprocess filters > send to remote": "220.00µs",
  "preprocess filters > execute local > evaluate filter": "139.00µs",
  "preprocess filters > execute local": "1.61ms",
  "preprocess filters > wait for remote": "35.97ms",
  "preprocess filters": "39.01ms",
  "process > prepare": "96.00µs",
  "process > send to remote": "118.00µs",
  "process > execute local > load field ids map": "63.00µs",
  "process > execute local > query[0] > evaluate filter": "84.00µs",
  "process > execute local > query[0] > tokenize query": "163.00µs",
  "process > execute local > query[0] > evaluate query": "116.00µs",
  "process > execute local > query[0] > keyword ranking": "634.00µs",
  "process > execute local > query[0]": "1.52ms",
  "process > execute local > pin hits": "29.00µs",
  "process > execute local > format": "36.00µs",
  "process > execute local": "2.90ms",
  "process > wait for remote": "37.24ms",
  "process > merge": "82.00µs",
  "process": "40.45ms",
  "hydrate > send to remote": "38.00µs",
  "hydrate > execute local": "35.00µs",
  "hydrate > wait for remote": "41.00µs",
  "hydrate": "295.00µs",
  "merge facets": "51.00µs"
}

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

🔩 杂项

新贡献者

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

更新内容 (原始)

💥 Breaking Changes

Meilisearch v1.54.0 makes breaking changes to the dynamicSearchRules experimental features.

  • For Cloud users, rules will be migrated automatically, and the UI will adapt to the new API. Only the first change on rulelist might affect users that directly get rules through the API.
  • If upgrading with --upgrade-db, rules will be migrated automatically.
  1. The POST /dynamic-search-rules endpoint now returns actions as an object with 2 fields instead of a list:

  2. pin is an array of Pin objects with the following fields:

    1. id, String, mandatory: document id of the document to pin
    2. position: positive or zero number, mandatory: position where to pin the document
    3. indexUid, optional, defaults to null, uid of the index that this action applies to. If null or missing, the action applies to any index containing a document with the provided id.
  3. scale is an array of Scale objects with the following fields:

    1. weight, positive or zero number, mandatory: scaling factor to multiply with the selected documents’ innate relevancy score
    2. ids, array of strings, optional: list of document ids whose document’s relevancy score should be scaled by the provided weight
    3. filter: Meilisearch filter without a foreign filter, optional: a filter on the index that is resolved to determine a list of selected documents
    4. indexUid, optional, defaults to null, uid of the index that this action applies to. If null or missing, the action applies to any index.
  4. The PATCH /dynamic-search-rules/{:ruleUid} endpoint now expects a rule with the modified actions field. See changes to POST /dynamic-search-rules for details.

  5. The uid __meilisearch_metadata is now reserved and cannot be used as a ruleUid in PATCH /dynamic-search-rules/{:ruleUid}

🌈 Enhancements

Boost, demote and hide documents with search rules

  • A dynamic search rule can now boost, deboost or hide documents by defining a new “scale” action that selects some documents by filter and/or an explicit list of ids and exposes a scale factor as a weight:
    • If the weight is > 1.0, then the selected documents are boosted
    • If the weight is < 1.0, then the selected documents are deboosted (demoted)
    • If the weight is = 0.0, then the selected documents are hidden and don’t appear in search results (unless if they are also pinned)
    • ⚠️ Because the factor is applied to the relevancy rules, it has little measurable effect when the first ranking rule is not a relevancy rule.
  • Score details for a pinned document now contains an additional ruleUid field indicating the name of the rule that resulted in the document being pinned. ⚠️ As a result, end-users can find out the uid of applied rules by looking at ranking score details. Please keep any sensitive information in the description of the rule instead ⚠️
  • Score details for a scaled document now contains an additional scale field, with order 0. The scale field is an object with the following fields:
    • order: order of application of the rule. Always 0
    • actions: an array of ScaleActions, where each ScaleAction contains the following fields:
      • ruleUid: the name of the rule that was applied
      • weight the weight of the rule that was applied
    • totalWeight: the total multiplicative factor computed as the product of the individual .actions[].weight.
  • New environment variables controlling how much scale operations can occur:
    • MEILI_EXPERIMENTAL_DSR_FUEL_MAX_SCALE_ACTIONS: maximum number of applicable (at least one selected document) scale actions in a single search. Range 1-255, default 10
    • MEILI_EXPERIMENTAL_DSR_FUEL_SCALE_FUEL: maximum number of combinations of scale constraint that are evaluated in a single search. Range 1-255, default 10.

Examples

Boosting "Batman" product for a festival
  1. Creating the search rule
// PATCH /dynamic-search-rule/batman-festival

{
  "conditions": {
    "time": {
      "start": "2026-09-21T19:00:00Z",
      "end": "2026-09-28T18:59:00Z"
    },
  },
  "actions": {
    "scale": [
      {
        "filter": "series = batman",
        "weight": 4.0
      }
    ]
  }
}
  1. Once the DSR update task has been processed and the festival begins on September 21st, make a search query:
{
  "q": "superhero returns prequel",
  "showRankingScoreDetails": true
}
  1. Observe the ranking of documents

"hits": [
        {
          "id": "batman-returns",
          "title": "Batman Returns",
          "series": "batman",
          "_rankingScore": 0.30808080808080807,
          "_rankingScoreDetails": {
            "scale": {
              "order": 0,
              "actions": [
                {
                  "ruleUid": "batman-festival",
                  "weight": 4.0
                }
              ],
              "totalWeight": 4.0
            },
            "words": {
              "order": 1,
              "matchingWords": 1,
              "maxMatchingWords": 3,
              "score": 0.3333333333333333
            },
            "typo": {
              "order": 2,
              "typoCount": 0,
              "maxTypoCount": 1,
              "score": 1.0
            },
            "proximity": {
              "order": 3,
              "score": 1.0
            },
            "attributeRank": {
              "order": 4,
              "score": 1.0
            },
            "wordPosition": {
              "order": 5,
              "score": 0.9090909090909092
            },
            "exactness": {
              "order": 6,
              "matchType": "noExactMatch",
              "matchingWords": 1,
              "maxMatchingWords": 1,
              "score": 0.3333333333333333
            }
          }
        },
        {
          "id": "superman-returns",
          "series": "superman",
          "title": "Superman Returns - The Prequels",
          "_rankingScore": 0.9628456221198156,
          "_rankingScoreDetails": {
            "words": {
              "order": 0,
              "matchingWords": 3,
              "maxMatchingWords": 3,
              "score": 1.0
            },
            "typo": {
              "order": 1,
              "typoCount": 0,
              "maxTypoCount": 3,
              "score": 1.0
            },
            "proximity": {
              "order": 2,
              "score": 0.5714285714285714
            },
            "attributeRank": {
              "order": 3,
              "score": 1.0
            },
            "wordPosition": {
              "order": 4,
              "score": 0.9032258064516128
            },
            "exactness": {
              "order": 5,
              "matchType": "noExactMatch",
              "matchingWords": 2,
              "maxMatchingWords": 3,
              "score": 0.25
            }
          }
        },
        // ...
      ],
      "processingTimeMs": "[duration]",
      "limit": 20,
      "offset": 0,
      "estimatedTotalHits": 42,
      "requestUid": "[uuid]"
    }
Demoting out-of-stock products
// PATCH /dynamic-search-rules/out-of-stock

{
  "actions": {
    "scale": [
      {
        "filter": "availability = \"out of stock\"",
        "weight": 0.5
      }
    ]
  }
}
Hiding discontinued products
// PATCH /dynamic-search-rules/discontinued

{
  "actions": {
    "scale": [
      {
        "filter": "availability = discontinued",
        "weight": 0.0
      }
    ]
  }
}

By @dureuill in https://github.com/meilisearch/meilisearch/pull/6549

MCP endpoint

We introduce a new MCP protocol on the /mcp path. It implements the HTTP+SSE Transport version of the protocol. You can register the Meilisearch MCP in your favorite LLM, e.g., Claude Code, Codex. Note that the MCP route is using bearer authentication and doesn’t support OAuth authentication.

Enable the mcpRoute experimental feature to use the feature.

by @Kerollmops in https://github.com/meilisearch/meilisearch/pull/6629

The performance details in a federated search now separate the timing per query

Example
"performanceDetails": {
  "wait in queue": "1.36ms",
  "preprocess filters > prepare": "985.00µs",
  "preprocess filters > send to remote": "220.00µs",
  "preprocess filters > execute local > evaluate filter": "139.00µs",
  "preprocess filters > execute local": "1.61ms",
  "preprocess filters > wait for remote": "35.97ms",
  "preprocess filters": "39.01ms",
  "process > prepare": "96.00µs",
  "process > send to remote": "118.00µs",
  "process > execute local > load field ids map": "63.00µs",
  "process > execute local > query[0] > evaluate filter": "84.00µs",
  "process > execute local > query[0] > tokenize query": "163.00µs",
  "process > execute local > query[0] > evaluate query": "116.00µs",
  "process > execute local > query[0] > keyword ranking": "634.00µs",
  "process > execute local > query[0]": "1.52ms",
  "process > execute local > pin hits": "29.00µs",
  "process > execute local > format": "36.00µs",
  "process > execute local": "2.90ms",
  "process > wait for remote": "37.24ms",
  "process > merge": "82.00µs",
  "process": "40.45ms",
  "hydrate > send to remote": "38.00µs",
  "hydrate > execute local": "35.00µs",
  "hydrate > wait for remote": "41.00µs",
  "hydrate": "295.00µs",
  "merge facets": "51.00µs"
}

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

🔩 Miscellaneous

New Contributors

Full Changelog: https://github.com/meilisearch/meilisearch/compare/v1.53.2...v1.54.0

下载链接