0

es.search({size: 0, suggest: ...}使用完成映射在可以具有非拉丁变音符号(重音字符,如 â、ê 等)的字段上使用完成映射,自动完成工作正常。

我正在使用创建映射mongoosastic。我需要能够使用诸如asciifolding建议之类的东西或在响应中添加其他字段。

我有这些领域:

  • name这是带有变音符号的那个。
  • nameSearch这是name拉丁化的(没有变音符号/重音字符)。

我需要的是继续完成建议,name但处理方式a相同â(和其他方式)。

在我需要的回应name中。不是nameSearch

4

1 回答 1

0

我再次偶然发现了这个问题,这次没有mongoosastic. 答案是settings在索引查询中有字段(mongoosastic您可以在使用自定义映射时添加它)。

settings: {
  analysis: {
    analyzer: {
      folding: {
        tokenizer: 'standard',
        filter: ['lowercase', 'custom_asciifolding'],
      },
    },
    filter: {
      custom_asciifolding: {
        type: 'asciifolding',
        preserve_original: true,
      },
    },
  },
}
于 2017-09-25T13:12:53.790 回答