使用 man ascii 来查看 ASCII 表。

logstash同步父子关系到ElasticSearch报错,求教

Logstash | 作者 l433608734 | 发布于2018年11月30日 | 阅读数:2632


TIM截图20181130182123.png

TIM截图20181130182242.png

如图是我的索引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"}
 
求大神指点一下
 
 
已邀请:

laoyang360 - 《一本书讲透Elasticsearch》作者,Elastic认证工程师 [死磕Elasitcsearch]知识星球地址:http://t.cn/RmwM3N9;微信公众号:铭毅天下; 博客:https://elastic.blog.csdn.net

赞同来自: l433608734

这里父子关联不太好借助logstash实现,参见:https://discuss.elastic.co/t/l ... 47667 很久没有答案。
建议:
通过java程序,
步骤1:读取数据,
步骤2:然后指定逻辑parent关系,
步骤3:批量写入。
通过以上三步,建立父子关联在ES中。

要回复问题请先登录注册