Azure 搜索 - 捷克语的基本搜索

Azure Search - basic search in Czech language

我在 Azure 搜索服务中创建了一个索引,其中有几个字符串字段标记为可使用 Czech - Lucene 分析器进行搜索。在捷克语中,我们使用一些重音字符,人们在打字时将重音字符替换为非重音字符是很常见的。因此,例如 "Václav"(名称)与 "Vaclav" 具有相同的含义。在我的索引中,我几乎没有包含单词 "Václav" 和 none 以及单词 "Vaclav".

的文档

正如我所期望的那样,当我搜索 "Vaclav" 时,Azure 搜索会 return 所有包含单词 "Václav" 的文档,但事实并非如此。我想知道在发送到搜索引擎之前是否必须以某种方式解析查询。

我 运行 我通过 Azure 门户(将 API 版本设置为 2015-02-28-Preview)和我的代码使用最新的 SDK Microsoft.Azure.Search 1.1 进行了测试。 1.

默认情况下 Lucene 和 Microsoft analyzers for the Czech language don't ignore diacritics. The easiest way to achieve what you want is to use standardasciifolding.lucene analyzer instead. Alternatively, you could build a custom analyzer 将 ASCII 折叠标记过滤器添加到捷克语的标准分析链。例如:

{
  "name":"example",
  "fields":[
    {
      "name":"id",
      "type":"Edm.String",
      "key":true
    },
    {
      "name":"text",
      "type":"Edm.String",
      "searchable":true,
      "retrievable":true,
      "analyzer":"my_czech_analyzer"
    }
  ],
  "analyzers":[
    {
      "name":"my_czech_analyzer",
      "@odata.type":"#Microsoft.Azure.Search.CustomAnalyzer",
      "tokenizer":"standard",
      "tokenFilters":[
        "lowercase",
        "czech_stop_filter",
        "czech_stemmer",
        "asciifolding"
      ]
    }
  ],
  "tokenFilters":[
    {
      "name":"czech_stop_filter",
      "@odata.type":"#Microsoft.Azure.Search.StopTokenFilter",
      "stopwords_list":"_czech_"
    },
    {
      "name":"czech_stemmer",
      "@odata.type":"#Microsoft.Azure.Search.StemmerTokenFilter",
      "language":"czech"
    }
  ]
}

我们意识到现在的体验不是最佳的。我们正在努力让这样的定制变得更容易。

如果这回答了您的问题,请告诉我