From b3febadf2c67d5128398a25127a4ef5c2a4292e2 Mon Sep 17 00:00:00 2001 From: ghee wooi Date: Tue, 24 May 2016 13:57:40 +0800 Subject: [PATCH] fixed index out of bound exception when index certain features type. --- .../elasticsearch/index/query/image/AbstractImageScorer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/elasticsearch/index/query/image/AbstractImageScorer.java b/src/main/java/org/elasticsearch/index/query/image/AbstractImageScorer.java index ecd380f..426402c 100644 --- a/src/main/java/org/elasticsearch/index/query/image/AbstractImageScorer.java +++ b/src/main/java/org/elasticsearch/index/query/image/AbstractImageScorer.java @@ -44,7 +44,7 @@ public float score() throws IOException { try { BytesRef bytesRef = binaryDocValues.get(docID()); LireFeature docFeature = lireFeature.getClass().newInstance(); - docFeature.setByteArrayRepresentation(bytesRef.bytes); + docFeature.setByteArrayRepresentation(bytesRef.bytes, bytesRef.offset, bytesRef.length); double distance = lireFeature.getDistance(docFeature); double score;