curl -XPUT 'http://localhost:9200/images/' -d '{
"settings" : {
"number_of_shards" : 5,
"number_of_replicas" : 1,
"index.version.created" : 1070499
},
"mappings" : {
"images": {
"properties": {
"img": {
"type": "image",
"feature": {
"CEDD": {
"hash": ["BIT_SAMPLING"]
},
"JCD": {
"hash": ["BIT_SAMPLING", "LSH"]
}
},
"metadata": {
"jpeg.image_width": {
"type": "string",
"store": "yes"
},
"jpeg.image_height": {
"type": "string",
"store": "yes"
}
}
}
}
}
}
}'
@Document(indexName = "images", type = "images")
public class Image {
@Id
private String id;
private String img;
public Image() {
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getImg() {
return img;
}
public void setImg(String img) {
this.img = img;
}
}
byte[] imageBase64 = Base64.encodeBase64(IOUtils.toByteArray(inputStream));
Image image = new Image();
image.setImg(new String(imageBase64));
IndexQuery query = new IndexQueryBuilder().withIndexName("images").withObject(image).build();
String id = elasticsearchTemplate.index(query);
[2016-07-03 11:14:54,685][WARN ][index.codec ] [Crime Master] [images] no index mapper found for field: [img.CEDD.hash.BIT_SAMPLING] returning default postings format
[2016-07-03 11:14:54,687][WARN ][index.codec ] [Crime Master] [images] no index mapper found for field: [img.JCD.hash.BIT_SAMPLING] returning default postings format
[2016-07-03 11:14:54,688][WARN ][index.codec ] [Crime Master] [images] no index mapper found for field: [img.JCD.hash.LSH] returning default postings format