【问题标题】:Azure Search - unaccentAzure 搜索 - 不重音
【发布时间】:2018-02-20 23:13:41
【问题描述】:

试图弄清楚如何在天蓝色搜索中获得忽略重音的能力。我的申请中的文字是波兰语的。对于可搜索字段,我尝试使用 pl.microsoft 和 pl.lucene 分析器。他们都能够将单数形式变为复数形式。我无法做到的是忽略口音。我发现(How to ignore accents in Azure Search?)的唯一方法是使用standardasciifolding.lucene 分析器。它忽略重音,但另一方面不会将形式从单数变为复数。有什么方法可以组合两个分析器?

谢谢

【问题讨论】:

    标签: azure-cognitive-search


    【解决方案1】:

    我想我找到了解决方案,但我不确定这是否是最简单的方法,或者我可能过于复杂:

    {
        "name": "test",
        "fields": [
            {
                "name": "id",
                "type": "Edm.String",
                "searchable": false,
                "filterable": false,
                "retrievable": true,
                "sortable": false,
                "facetable": false,
                "key": true,
                "indexAnalyzer": null,
                "searchAnalyzer": null,
                "analyzer": null
            },
            {
                "name": "name",
                "type": "Edm.String",
                "searchable": false,
                "filterable": true,
                "retrievable": true,
                "sortable": false,
                "facetable": false,
                "key": false,
                "indexAnalyzer": null,
                "searchAnalyzer": "pl_analyzer",
                "analyzer": null
            }
        ],
        "scoringProfiles": [],
        "defaultScoringProfile": "",
        "corsOptions": null,
        "suggesters": [],
        "analyzers":[
        {
          "name":"pl_analyzer",
          "@odata.type":"#Microsoft.Azure.Search.CustomAnalyzer",
          "tokenizer":"polish_tokenizer",
          "tokenFilters":[ "lowercase", "asciifolding"  ]
        }],
        "tokenizers": [
        {
          "@odata.type": "#Microsoft.Azure.Search.MicrosoftLanguageStemmingTokenizer",
          "name": "polish_tokenizer",
          "isSearchTokenizer": true,
          "language": "polish"
        }
        ],
        "tokenFilters": [],
        "charFilters": []
    }
    

    【讨论】:

    • 这是解决问题的正确方法。 asciifolding 过滤器将重音字符是它自己的字符(例如波兰语)的语言中的“重音”字符映射到基本拉丁脚本中。这实现了去除重音。此外,MicrosoftLanguageStemmingTokenizer 会进行词干提取(其中一种效果是删除复数形式,它也可能会删除与时态相关的后缀)。您可以在此处参考文档:docs.microsoft.com/en-us/rest/api/searchservice/…,了解 Azure 搜索中可用的不同令牌过滤器。
    猜你喜欢
    • 2019-07-01
    • 1970-01-01
    • 2012-12-10
    • 1970-01-01
    • 2015-09-28
    • 2013-05-16
    • 2017-08-21
    • 2011-11-22
    • 1970-01-01
    相关资源
    最近更新 更多