Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/scala/19.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
更新映射定义是使用Scala的ELasticSearch_Scala_<img Src="//i.stack.imgur.com/RUiNP.png" Height="16" Width="18" Alt="" Class="sponsor Tag Img">elasticsearch_Elastic4s - Fatal编程技术网 elasticsearch,elastic4s,Scala,elasticsearch,Elastic4s" /> elasticsearch,elastic4s,Scala,elasticsearch,Elastic4s" />

更新映射定义是使用Scala的ELasticSearch

更新映射定义是使用Scala的ELasticSearch,scala,elasticsearch,elastic4s,Scala,elasticsearch,Elastic4s,我想知道如何更新现有索引的映射。 所以我有一个索引: { "state": "xxx", "settings": { "index": { "creation_date": "xxx", "number_of_shards": "xxx", "number_of_replicas": "xxx", "uuid": "xxx", "version"

我想知道如何更新现有索引的映射。 所以我有一个索引:

{
    "state": "xxx",
    "settings": {
        "index": {
            "creation_date": "xxx",
            "number_of_shards": "xxx",
            "number_of_replicas": "xxx",
            "uuid": "xxx",
            "version": {
                "created": "xxx"
            }
        }
    },
    "mappings": {
        "es_content_entry": {
            "properties": {
                "input": {
                    "properties": {
                        "zipCode": {
                            "type": "string"
                        },
                        "address": {
                            "type": "string"
                        },
                        "cityName": {
                            "type": "string"
                        },
                    }
                }
            }
        }
    }
}

我正在使用scala更新此索引的映射,如下所示: CheckFieldMappingResult是具有

indexName: String,
entryType: String,
path: Seq[String],
localMapping: Option[TypedFieldDefinition],
remoteJsonMapping : Option[JsObject],
isConsistent: Boolean,
status: String

它在索引的开头添加了附加信息,但我希望它添加这个路径
index\u NAME\es\u content\u entry\input\addationalinfos

我该怎么做呢?

elastic4s是基于Scala的库,支持创建索引

https://github.com/sksamuel/elastic4s

我为所有路径值创建了一个TypedFieldDefinition对象

for(

  pathToken <- path.reverse.drop(1)

) {

  fullTypedFieldDefinition = FieldDefinition.objectField(Seq(fullTypedFieldDefinition))(pathToken)

}
用于(
pathToken
https://github.com/sksamuel/elastic4s
for(

  pathToken <- path.reverse.drop(1)

) {

  fullTypedFieldDefinition = FieldDefinition.objectField(Seq(fullTypedFieldDefinition))(pathToken)

}