如何将分析器添加到 elasticsearch spring 数据中的嵌套字段?

How to add analyzer to the nested fields in elasticsearch spring data?

我的架构实际上包括如下所示的嵌套类型。

这是主架构。

@Document(indexName = "agreement")
public class PromotionSearchSchema {

@Field(type = FieldType.Nested, includeInParent = true)
    private Promotion promotionproduct;

}

现在,促销是主模式中的另一个实体。所以我将其标记为嵌套类型。在促销实体中,我正在尝试添加分析器,如下所示

@Setting(settingPath = "es-config/elastic-analyzer.json")
public class Promotion {

 @Field(type = FieldType.Text, analyzer = "autocomplete_index", searchAnalyzer = "autocomplete_search")
    private String promotionDescription;

}

这是我的弹力-analyzer.json

{
  "analysis": {
    "filter": {
      "autocomplete_filter": {
        "type": "edge_ngram",
        "min_gram": 1,
        "max_gram": 20
      }
    },
    "analyzer": {
      "autocomplete_search": {
        "type": "custom",
        "tokenizer": "standard",
        "filter": [
          "lowercase"
        ]
      },
      "autocomplete_index": {
        "type": "custom",
        "tokenizer": "standard",
        "filter": [
          "lowercase",
          "autocomplete_filter"
        ]
      }
    }
  }
}

当我喜欢时,它根本不会在 Elasticsearch 中创建完整的映射。它只是创建如下所示

{
  "agreement" : {
    "mappings" : { }
  }
}

所以我的问题是如何在嵌套类型中添加分析器。任何帮助将不胜感激。

@Setting 注释添加到顶级实体。