Skip to content

Commit

Permalink
avoid logging confusing message during delete
Browse files Browse the repository at this point in the history
also identify new value for att_reason "invalid_json"
closes #50
  • Loading branch information
mschoch committed Nov 4, 2014
1 parent 83e5880 commit 0d4cb62
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.couchbase</groupId>
<artifactId>elasticsearch-transport-couchbase</artifactId>
<version>2.0.0</version>
<version>2.0.1-SNAPSHOT</version>

<properties>
<elasticsearch.version>1.3.0</elasticsearch.version>
Expand Down
Expand Up @@ -296,7 +296,10 @@ public List<Object> bulkDocs(String database, List<Map<String, Object>> docs) th
// if there is no meta-data section, there is nothing we can do
logger.warn("Document without meta in bulk_docs, ignoring....");
continue;
} else if("non-JSON mode".equals(meta.get("att_reason"))) {
} else if(meta.containsKey("deleted")) {
// if this is only a delete anyway, don't bother looking at the body
json = new HashMap<String, Object>();
} else if("non-JSON mode".equals(meta.get("att_reason")) || "invalid_json".equals(meta.get("att_reason"))) {
// optimization, this tells us the body isn't json
json = new HashMap<String, Object>();
} else if(json == null && base64 != null) {
Expand Down

0 comments on commit 0d4cb62

Please sign in to comment.