【问题标题】:Azure Search Microsoft English Search AnalyzerAzure 搜索 Microsoft 英语搜索分析器
【发布时间】:2018-08-30 13:39:09
【问题描述】:

我正在尝试在 autopart 产品的描述字段中使用 Microsoft 英语分析器。我遇到了一些关于十进制测量值的意外行为,所以我通过分析 API 运行它来确认,看起来词形还原算法使用小数点作为信号/分隔符来将整数和十进制值分解为两个单独的标记,我不这样做'不认为这是一种期望的行为。

例如。

文字:“M12-1.50 车轮螺栓 - 14mm。六角,23.12mm。螺纹长度 14mm。

被分解为

{
"@odata.context": "https://site.search.windows.net/$metadata#Microsoft.Azure.Search.V2017_11_11.AnalyzeResult",
"tokens": [
 {
    "token": "m12-1",
    "startOffset": 0,
    "endOffset": 5,
    "position": 0
    },
    {
    "token": "m12",
    "startOffset": 0,
    "endOffset": 3,
    "position": 0
    },
    {
    "token": "1",
    "startOffset": 4,
    "endOffset": 5,
    "position": 1
    },
    {
    "token": "nn1",
    "startOffset": 4,
    "endOffset": 5,
    "position": 1
    },
    {
    "token": "50",
    "startOffset": 6,
    "endOffset": 8,
    "position": 2
    },
    {
    "token": "nn50",
    "startOffset": 6,
    "endOffset": 8,
    "position": 2
    },
    {
    "token": "wheel",
    "startOffset": 9,
    "endOffset": 14,
    "position": 3
    },
    {
    "token": "bolt",
    "startOffset": 15,
    "endOffset": 19,
    "position": 4
    },
    {
    "token": "14mm",
    "startOffset": 22,
    "endOffset": 26,
    "position": 5
    },
    {
    "token": "hex",
    "startOffset": 29,
    "endOffset": 32,
    "position": 6
    },
    {
    "token": "23",
    "startOffset": 34,
    "endOffset": 36,
    "position": 7
    },
    {
    "token": "nn23",
    "startOffset": 34,
    "endOffset": 36,
    "position": 7
    },
    {
    "token": "12mm",
    "startOffset": 37,
    "endOffset": 41,
    "position": 8
    },
    {
    "token": "thread",
    "startOffset": 44,
    "endOffset": 50,
    "position": 9
    },
    {
    "token": "length",
    "startOffset": 51,
    "endOffset": 57,
    "position": 10
    },
    {
    "token": "14mm",
    "startOffset": 58,
    "endOffset": 62,
    "position": 11
    }
]
}

搜索 12 毫米车轮螺栓的人会返回该值。

任何帮助将不胜感激:)

谢谢!

【问题讨论】:

    标签: azure azure-cognitive-search


    【解决方案1】:

    这是预期的行为。 Microsoft 英语分析器会将小数视为分隔符并生成 2 个单独的标记。

    如果您想在几个字段上执行精确匹配(例如:搜索“M12-1.50 Wheel Bolt - 14mm. Hex, 23.12mm”),那么我建议使用带有小写标记器的“关键字”分析器。

    您可以在此处阅读更多信息:https://docs.microsoft.com/en-us/rest/api/searchservice/custom-analyzers-in-azure-search

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-10-30
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多