diff --git a/pom.xml b/pom.xml index 267c6fa..e716fe4 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.visenze visearch-java-sdk ViSearch Java SDK - 1.14.4 + 1.14.5 jar https://github.com/visenze/visearch-sdk-java ViSearch Java SDK diff --git a/src/main/java/com/visenze/visearch/internal/DataOperationsImpl.java b/src/main/java/com/visenze/visearch/internal/DataOperationsImpl.java index fae6a36..5485200 100644 --- a/src/main/java/com/visenze/visearch/internal/DataOperationsImpl.java +++ b/src/main/java/com/visenze/visearch/internal/DataOperationsImpl.java @@ -47,7 +47,6 @@ public InsertTrans insert(List imageList, Map customParam JsonNode statusNode = responseNode.get("status"); if (statusNode == null) { throw new InternalViSearchException(ResponseMessages.INVALID_RESPONSE_FORMAT, response); - // throw new ViSearchException("There was a malformed ViSearch response: " + response, response); } else { InsertTrans insertTrans = deserializeObjectResult(response, response, InsertTrans.class); insertTrans.setHeaders(headers); @@ -55,10 +54,8 @@ public InsertTrans insert(List imageList, Map customParam } } catch (JsonProcessingException e) { throw new InternalViSearchException(ResponseMessages.PARSE_RESPONSE_ERROR, e, response); - //throw new ViSearchException("Could not parse the ViSearch response: " + response, e, response); } catch (IOException e) { throw new InternalViSearchException(ResponseMessages.PARSE_RESPONSE_ERROR, e, response); - //throw new ViSearchException("Could not parse the ViSearch response: " + response, e, response); } } catch (InternalViSearchException e) { return new InsertTrans(e.getMessage(), e.getCause(), e.getServerRawResponse()); @@ -67,7 +64,6 @@ public InsertTrans insert(List imageList, Map customParam @Override public InsertStatus insertStatus(String transId) { - return insertStatus(transId, Maps.newHashMap()); } @@ -187,11 +183,16 @@ private static Multimap imageListToParams(List imageList) Image image = imageList.get(i); if (image != null) { params.put("im_name" + "[" + i + "]", image.getImName()); - params.put("im_url" + "[" + i + "]", image.getImUrl()); + if (image.getImUrl() != null) { + params.put("im_url" + "[" + i + "]", image.getImUrl()); + } + Map metadata = image.getMetadata(); if (metadata != null) { for (Map.Entry entry : metadata.entrySet()) { - params.put(entry.getKey() + "[" + i + "]", entry.getValue()); + if (entry.getValue() != null) { + params.put(entry.getKey() + "[" + i + "]", entry.getValue()); + } } } }