Image Elasticsearch如何使用图像插件获取元数据
我通过Elasticsearch图像插件的映射定义了matadata 映射:Image Elasticsearch如何使用图像插件获取元数据,image,plugins,
elasticsearch,metadata,Image,Plugins,
elasticsearch,Metadata,我通过Elasticsearch图像插件的映射定义了matadata 映射: "photo" : { "mappings" : { "scenery" : { "properties" : { "my_img" : { "type" : "image", "feature" : {"FCTH" : { }, ... }, "metadata" : { "jpeg.image
"photo" : {
"mappings" : {
"scenery" : {
"properties" : {
"my_img" : {
"type" : "image",
"feature" : {"FCTH" : { }, ... },
"metadata" : {
"jpeg.image_height" : {"type" : "string","store" : true},
"jpeg.image_width" : {"type" : "string","store" : true}
}
}
}
}
}
}
索引之后,尽管已搜索,但元数据不会返回。
如何获取元数据
我试过:
curl -XPOST 'localhost:9200/photo/scenery/_search' -d '{
"query":{
"image":{
"my_img":{
"feature":"CEDD",
"index":"photo",
"type":"scenery",
"id":"0",
"path":"my_img",
"hash":"BIT_SAMPLING"
}
}
}
}'
结果:
{"took":14,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":5,"max_score":1.0,"hits":[{"_index":"photo","_type":"scenery","_id":"0","_score":1.0, "_source" : {"file_name": "376423.jpg", "my_img": "/9j/4AAQSkZJRgABAQ...
也许,原始数据(base64编码图像)将返回源字段。您可以使用该选项 尝试此查询
curl -XPOST 'localhost:9200/photo/scenery/_search' -d '{
"query":{
...
},
"fields": ["my_img.metadata.jpeg.image_height","my_img.metadata.jpeg.image_width" ]
}'