[英]Insert object (as a folder) in Google Cloud Storage using JSON API with Java
[英]How to insert any nested json object to elasticsearh by using JAVA API
在我的项目中,我们使用flink来处理日志数据,然后我们将数据发送到elasticsearch中。 但是,我发现es无法识别json对象,它只能识别一些基本的数据类型。 所以我只能把json对象转成字符串,但是这个时候在elasticsearch中查看日志数据的时候,格式真的很难理解。
"hits" : {
"total" : 10,
"max_score" : 1.0,
"hits" : [
{
"_index" : "wyh_dye_test",
"_type" : "nested",
"_id" : "gzlvM3EBRgA6CE7yDw8l",
"_score" : 1.0,
"_source" : {
"id" : "id",
"module" : "wyh_key",
"content" : """{"map":{"wyh_key":"wyh_value","user_key":"user_value","wqq_key":"wqq_value","hello_key":"hello_value"}}"""
}
}
这是我的 kibana 搜索结果,如您所见,内容字段真的很难阅读。
您可以更新此索引映射,然后将数据放入相应的字段中。
PUT xxx_index/_mapping/xxx_type
{
"properties": {
"wyh_key": {
"type": "keyword"
},
"user_key": {
"type": "keyword"
},
"wqq_key": {
"type": "keyword"
},
"hello_key": {
"type": "keyword"
}
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.