首页 > 解决方案 > 弹性搜索数据上传

问题描述

我有一个映射如下的索引,我需要将值加载到 name_1 字段。任何人都知道弹性中的哪个命令会做这样的事情?

{
"universitiesel": {
  "mappings": {
   "Universitiesel": {
     "properties": {
       "name": {
        "type": "text",
          "fields": {
           "keyword": {
           "type": "keyword",
           "ignore_above": 256
         }
        }
      },
        "name_1": {
        "type": "keyword"
      },
        "name_2": {
        "type": "text"
      }
     }
    }
  }
 }
}

标签: elasticsearchimport

解决方案


参考

curl -H 'Content-Type: application/x-ndjson' -XPOST 'localhost:9200/shakespeare/doc/_bulk?pretty' --data-binary @shakespeare_6.0.json

来源:https ://www.elastic.co/guide/en/kibana/current/tutorial-load-dataset.html


推荐阅读