Azure 搜索 - 是否可以像 ElasticSearch 一样在单个字段上使用多个分析器?

Azure Search - Are multiple analyzers on single field like ElasticSearch possible?

我正在比较 Azure 搜索和 ElasticSearch 的功能和性能。
我正在查看是否可以为每个字段设置多个分析器。
在 ElasticSearch 中我可以做到这一点

      "Name": {
        "type": "text",
        "analyzer": "ingram",
        "fields": {
          "partial": {
            "type": "text",
            "analyzer": "customWhitespace",
            "boost": 2
          },
          "exact": {
            "type": "text",
            "analyzer": "customKeyword",
            "boost": 3
          }
        }
      },

由于两种技术相似,我尝试在 Azure 中复制相同的结构

    {
      "name": "text",
      "type": "Edm.String",
      "retrievable": true,
      "searchable": true,
      "sortable": true,
      "analyzer": "ingram",
      "fields": [
        {
            "name": "partial",
            "type": "Edm.String",
            "searchable": true,
            "analyzer": "customWhitespace",
        }
        ]
    },

但在创建索引时出错

The request is invalid. Details: definition : The field 'text' of type 
'Edm.String' cannot have sub-fields because it is not a complex type.

我找到了这个 post Azure Search: Implementing Partial Word Search 这似乎是说您必须创建一个辅助字段并将数据第二次加载到该字段中才能提供相同的功能。

有没有一种方法可以提供相同类型的功能,而无需将数据再次加载到另一个字段中?这只是人为地增加了我的索引大小。

我认为这里有两个不同的问题。第一个是您创建索引(或更具体地说是字段)的方式。在创建索引时,您将其构造为创建一个字段数组。在 Azure 认知搜索中,这就是我们所说的复杂类型,您可以找到更多 information here。如果您想创建多个字段,则无需将它们设置为复杂类型中的集合字段。您可以只在索引的根目录下创建它们。

对于你原来的问题,你只能对单个字段喜欢单个分析器(或自定义分析器)。这就是您在有关创建重复字段的问题中发表评论的原因。鉴于您似乎还想对不同的字段应用自定义提升,似乎这种方法也可以让您这样做。

希望对你有所帮助,利亚姆