0

我正在使用 algolia angular instantsearch 和 TypesenseInstantSearchAdapter。我创建了自定义 ais-refinement 列表组件,现在卡住了,因为当我在构面列表中搜索时,我得到的结果有错别字。1 我尝试将 numTypos: 0 添加到 serverSetting,它看起来像这样:

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,
  },
});
this.searchClient = this.typesenseInstantsearchAdapter.searchClient;

我还尝试添加到配置设置typoTolerance 或exactOnSingleWordQuery,它没有帮助

  config:{
  indexName: this.data.indexName,
  searchClient: this.searchClient,
  attributesForFaceting: this.attributes,
  typoTolerance: false,
  exactOnSingleWordQuery: 'word'}

我没有,也许我应该在创建细化列表时添加一些东西来连接参数?

 ngOnInit() {
this.createWidget(connectRefinementList, {
  // instance options
  attribute: this.attr,
  sortBy: this.defineSorting(this.sortBy),
  limit: 50,
});
super.ngOnInit();

}

4

1 回答 1

1

Typesense 服务器还没有用于禁用构面搜索拼写错误的参数 https://github.com/typesense/typesense/issues/429

于 2021-12-01T10:03:49.260 回答