You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何禁用Algolia ais-refinement list分面搜索的拼写纠错功能?

你之前的配置不生效有两个核心原因,修改Adapter配置即可解决,不需要在connectRefinementList参数中额外加配置。

不生效原因

  • 你在additionalSearchParameters中配置的numTypos: 0仅作用于主文档搜索请求,refinement list内部的分面搜索是独立的API请求,默认不会继承主搜索的拼写容错参数。
  • 你配置的typoTolerance、exactOnSingleWordQuery是Algolia的原生参数,TypesenseInstantSearchAdapter不会将其转换为Typesense侧可识别的参数,因此不会生效。

解决方法

在初始化TypesenseInstantSearchAdapter的additionalSearchParameters中,新增facetQueryNumTypos: 0参数,这个参数专门用于控制分面搜索时的拼写容错阈值,设为0即可完全禁用分面搜索的拼写纠错。
修改后的配置代码如下:

this.typesenseInstantsearchAdapter = new TypesenseInstantSearchAdapter({
  server: {
    apiKey: this.data.serverSettings.apikey,
    nodes: [
      {
        host: this.data.serverSettings.host,
        port: this.data.serverSettings.port,
        protocol: 'https',
      },
    ],
  },
  additionalSearchParameters: {
    queryBy: 'plaintexttitle',
    numTypos: 0, // 主搜索禁用拼写容错
    facetQueryNumTypos: 0 // 分面搜索禁用拼写容错,覆盖refinement list内搜索的默认配置
  },
});

补充说明:connectRefinementList的实例配置项仅支持InstantSearch通用的组件参数,无法透传Typesense的专属参数,所以不需要在该位置添加配置。

内容的提问来源于stack exchange,提问作者IvanVolkov42

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.09.24 01:57:03