如图是我的索引mapping 和 logstash给子文档同步数据的配置,同步会报错
例如:
Failed action. {:status=>400, :action=>["index", {:_id=>"fe7fe6a440664506aea87294f0e8f504", :_index=>"customer", :_type=>"customer_clue", :_routing=>nil, :parent=>"3f9fda4782fc44bbac8b8a354b6b2e62"}, 2018-11-30T09:55:00.727Z %{host} %{message}], :response=>{"index"=>{"_index"=>"customer", "_type"=>"customer_clue", "_id"=>"fe7fe6a440664506aea87294f0e8f504", "status"=>400, "error"=>{"type"=>"illegal_argument_exception", "reason"=>"can't specify parent if no parent field has been configured"}}}}
{"@timestamp":"2018-11-30T09:55:00.727Z","@version":"1","id":"fe7fe6a440664506aea87294f0e8f504","customer_id":"3f9fda4782fc44bbac8b8a354b6b2e62","content":"2232","last_date":"2018-11-30T09:52:49.000Z"}
求大神指点一下
1 个回复
laoyang360 - 《一本书讲透Elasticsearch》作者,Elastic认证工程师 [死磕Elasitcsearch]知识星球地址:http://t.cn/RmwM3N9;微信公众号:铭毅天下; 博客:https://elastic.blog.csdn.net
赞同来自: l433608734
建议:
通过java程序,
步骤1:读取数据,
步骤2:然后指定逻辑parent关系,
步骤3:批量写入。
通过以上三步,建立父子关联在ES中。