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
}
我没有看到排名特征字段选项,我想做排名特征类型的净销售额,请帮助!!
暂无答案!
目前还没有任何答案,快来回答吧!