如何在scala中向索引添加排名特征类型字段?

a11xaf1n  于 2021-06-13  发布在  ElasticSearch
关注(0)|答案(0)|浏览(292)
def createCompanyAutoCompleteIndex(indexName: String, host: String, port: Int = defaultPort,  shds: Int = defaultShards): Unit = {
    client(host, port).execute {
      createIndex(indexName).shards(shds).mappings {
        mapping(mappingName).as(
          keywordField("id"),
          textField("name_suggest").analyzer("autocomplete").searchAnalyzer("autocomplete_search"),
          keywordField("name"),
          longField("number_of_employees"),
        **longField("net_sales"),**
          intField("company_type_score")
        )
      }.analysis(
        Seq(CustomAnalyzerDefinition("autocomplete",EdgeNGramTokenizer("autocomplete", 2, 10, Seq("letter")), LowercaseTokenFilter),
        CustomAnalyzerDefinition("autocomplete_search", LowercaseTokenizer)))
    }.await
  }

我没有看到排名特征字段选项,我想做排名特征类型的净销售额,请帮助!!

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题