发布日期: 2025-04-14
版本号: v1.14.0

Meilisearch v1.14 版本提供了更细粒度的过滤器控制以优化索引性能,引入了复合嵌入器以改进搜索和索引时的向量生成,并新增了通过ID批量获取文档的接口。所有官方集成工具均兼容此版本,部分SDK可能尚未支持全部新功能。 新功能包括:1)细粒度可过滤属性设置,允许为每个文档属性单独启用或禁用不同的过滤类型以优化索引;2)复合嵌入器功能,支持在索引和搜索阶段分别使用不同的嵌入模型;3)新的文档批量检索接口,可通过ID列表获取多个文档。其他改进包括批量处理文档请求、增强分面搜索计数、降低内存消耗以及缓存搜索时的嵌入向量等。此外还修复了地理信息更新、前缀搜索及积分计算等若干问题,并更新了依赖库与测试用例。

更新内容 (中文)

Meilisearch v1.14 版本为索引性能优化提供了更精细的过滤器控制选项。此版本还引入了复合嵌入器(composite embedders),可在搜索和索引过程中提升向量生成效率,并新增了通过ID批量获取文档的接口。

🧰 所有官方 Meilisearch 集成(包括SDK、客户端及其他工具)均已兼容此版本。新版本发布后,集成部署将在4至48小时内完成。

部分SDK可能暂未包含所有新功能。请查阅项目仓库获取详细信息。若所选SDK缺少所需功能,可通过提交Issue告知我们,或直接发起PR实现(我们非常感谢您的贡献 ❤️)。

新特性与更新 🔥

细粒度可过滤属性设置

v1.14 版本允许您更精确地控制查询时禁用的过滤器类型,通过仅启用所需过滤功能进一步优化索引速度。

使用 PATCH /indexes/INDEX_NAME/settings 为文档中的每个属性配置启用的过滤器类型:

{
	"filterableAttributes": [
	  {
	    "attributePatterns": ["genre", "artist"],
	    "features": {
	      "facetSearch": true,
	      "filter": {
	        "equality": true,
	        "comparison": false
	      }
	    }
	  },
	  {
	    "attributePatterns": ["rank"],
	    "features": {
	      "facetSearch": false,
	      "filter": {
	        "equality": true,
	        "comparison": true
	      }
	    }
	  }
	]
}

详细文档请参阅专用文档页面

由 @ManyTheFish 在 #5254 中实现。

复合嵌入器

此特性支持在搜索与索引阶段使用不同的嵌入器,适用于优化AI驱动的搜索性能。例如您可能需要:

  • 索引时使用远程嵌入器(带宽更高,单位时间生成更多向量)
  • 搜索时使用本地嵌入器(延迟更低,响应速度更快)

启用步骤:

  1. 通过 Meilisearch Cloud 界面或 /experimental-features 路由启用复合嵌入器:
curl MEILISEARCH_URL/experimental-features \
  -H 'Content-Type: application/json'  \
  -d '{"compositeEmbedders": true}'
  1. 创建嵌入器时将 source 设为 "composite",并分别定义 searchEmbedderindexingEmbedder
{
  "embedders": {
    "text": {
      "source": "composite",
      "searchEmbedder": {
        "source": "huggingFace",
        "model": "baai/bge-base-en-v1.5",
        "revision": "a5beb1e3e68b9ab74eb54cfd186867f64f240e1a"
      },
      "indexingEmbedder": {
        "source": "rest",
        "url": "https://URL.endpoints.huggingface.cloud",
        "apiKey": "hf_XXXXXXX",
        "documentTemplate": "Your {{doc.template}}",
        "request": {
          "inputs": [
            "{{text}}",
            "{{..}}"
          ]
        },
        "response": [
          "{{embedding}}",
          "{{..}}"
        ]
      }
    }
  }
}
  1. 创建复合嵌入器后,Meilisearch将在索引时使用 indexingEmbedder,查询时使用 searchEmbedder

详细文档请参阅使用说明页面

由 @dureuill 在 #5371#5401 中实现。

通过ID批量获取文档

现支持通过ID批量获取文档:

curl -H 'Content-Type: application/json' MEILISEARCH_URL/indexes/INDEX_UID/documents -d '{ "ids": ["cody", "finn", "brandy", "gambit"] }'
{
  "results": [
    {
      "id": "brandy",
      "info": 13765493
    },
    {
      "id": "finn",
      "info": 35863
    },
    {
      "id": "cody",
      "info": 122263
    },
    {
      "id": "gambit",
      "info": 22222
    }
  ],
  "offset": 0,
  "limit": 20,
  "total": 4
}

[!WARNING] 文档返回顺序与查询顺序不同,不存在的文档将被忽略。

由 @dureuill 在 #5384 中实现。

其他改进

修复

其他事项

⚠️ 批处理统计信息可能随时变更

❤️ 再次感谢所有外部贡献者:

更新内容 (原始)

Meilisearch v1.14 gives more granular control over which parts of filters you can disable for indexing performance optimization. This release also includes composite embedders, which can improve embedding generation during search and indexing, and a new route to retrieve multiple documents by their IDs.

🧰 All official Meilisearch integrations (including SDKs, clients, and other tools) are compatible with this Meilisearch release. Integration deployment happens between 4 to 48 hours after a new version becomes available.

Some SDKs might not include all new features. Consult the project repository for detailed information. Is a feature you need missing from your chosen SDK? Create an issue letting us know you need it, or, for open-source karma points, open a PR implementing it (we’ll love you for that ❤️).

New features and updates 🔥

Granular filterable attribute settings

v1.14 gives you more control over which types of filter you want to disable in your searches. This allows you to further optimize indexing speeds by letting you activate only the filter features you need.

Use PATCH /indexes/INDEX_NAME/settings to specify which filters you want to enable for each attribute in your documents:

{
	"filterableAttributes": [
	  {
	    "attributePatterns": ["genre", "artist"],
	    "features": {
	      "facetSearch": true,
	      "filter": {
	        "equality": true,
	        "comparison": false
	      }
	    }
	  },
	  {
	    "attributePatterns": ["rank"],
	    "features": {
	      "facetSearch": false,
	      "filter": {
	        "equality": true,
	        "comparison": true
	      }
	    }
	  }
	]
}

For more details about this feature, please refer to the dedicated documentation page.

Done by @ManyTheFish in #5254.

Composite embedders

This feature allows using different embedders at search and indexing time. This can be useful when optimizing AI-powered search performance. For example, you may prefer to use:

  • A remote embedder during indexing, as remote embedders have higher bandwidth and can generate more embeddings per second
  • A local embedder when answering to search queries, as local embedders have lower latency and can respond more quickly to user input

To use the feature, follow these steps:

  1. Enable the Composite embedders feature with the Meilisearch Cloud interface, or with the /experimental-features route:
curl MEILISEARCH_URL/experimental-features \
  -H 'Content-Type: application/json'  \
  -d '{"compositeEmbedders": true}'
  1. Next, create an embedder, setting its source to "composite" and defining one searchEmbedder and one indexingEmbedder:
{
  "embedders": {
    "text": {
      "source": "composite",
      "searchEmbedder": {
        "source": "huggingFace",
        "model": "baai/bge-base-en-v1.5",
        "revision": "a5beb1e3e68b9ab74eb54cfd186867f64f240e1a"
      },
      "indexingEmbedder": {
        "source": "rest",
        "url": "https://URL.endpoints.huggingface.cloud",
        "apiKey": "hf_XXXXXXX",
        "documentTemplate": "Your {{doc.template}}",
        "request": {
          "inputs": [
            "{{text}}",
            "{{..}}"
          ]
        },
        "response": [
          "{{embedding}}",
          "{{..}}"
        ]
      }
    }
  }
}
  1. Once the composite embedder has been created, Meilisearch will use its indexingEmbedder during indexing and searchEmbedder when responding to user queries

For more details about this feature, please refer to its public usage page.

Done by @dureuill in #5371 and #5401.

Retrieve multiple documents by ID

It is now possible to retrieve multiple documents by their IDs:

curl -H 'Content-Type: application/json' MEILISEARCH_URL/indexes/INDEX_UID/documents -d '{ "ids": ["cody", "finn", "brandy", "gambit"] }'
{
  "results": [
    {
      "id": "brandy",
      "info": 13765493
    },
    {
      "id": "finn",
      "info": 35863
    },
    {
      "id": "cody",
      "info": 122263
    },
    {
      "id": "gambit",
      "info": 22222
    }
  ],
  "offset": 0,
  "limit": 20,
  "total": 4
}

[!WARNING] Documents are not returned in the queried order. Non-existent documents are ignored.

Done by @dureuill in #5384.

Other improvements

Fixes

Misc

⚠️ Please consider that the batches stats content can change anytime.

❤️ Thanks again to our external contributors:

下载链接