Repository: searchbox-io/Jest
Pull request #377 (2016-06-28 09:44:49)

Doc 'type' is optional in mget
In elasticsearch, Doc 'type' is optional in mget request. According to elastic documentation, If you don’t set the type and have many documents sharing the same _id, you will end up getting only the first matching document.
See https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-multi-get.html#mget-type


Patch:
diff --git a/.gitignore b/.gitignore
index 6c05ba9c..9ff9e13b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,7 @@
 # Common IDEs
 *.iml
-.idea/
+.idea
+.idea/**/*
 build/
 data/
 target/
@@ -10,6 +11,4 @@ target/
 .DS_Store
 jest/lib
 local.*
-lib/
-*.versionsBackup
 
diff --git a/jest-common/pom.xml b/jest-common/pom.xml
index b754b82f..2d681ccd 100644
--- a/jest-common/pom.xml
+++ b/jest-common/pom.xml
@@ -45,7 +45,7 @@
     <parent>
         <groupId>io.searchbox</groupId>
         <artifactId>jest-parent</artifactId>
-        <version>2.0.4-SNAPSHOT</version>
+        <version>2.0.3-SNAPSHOT</version>
     </parent>
 
     <dependencies>
diff --git a/jest-common/src/main/java/com/google/gson/GsonUtils.java b/jest-common/src/main/java/com/google/gson/GsonUtils.java
new file mode 100644
index 00000000..64958ce6
--- /dev/null
+++ b/jest-common/src/main/java/com/google/gson/GsonUtils.java
@@ -0,0 +1,14 @@
+package com.google.gson;
+
+/**
+ * This class is just a workaround for the non-public deepCopy methods in Gson.
+ */
+public class GsonUtils {
+    public static JsonObject deepCopy(JsonObject jsonObject) {
+        return jsonObject.deepCopy();
+    }
+
+    public static JsonElement deepCopy(JsonElement jsonElement) {
+        return jsonElement.deepCopy();
+    }
+}
diff --git a/jest-common/src/main/java/io/searchbox/action/AbstractMultiINodeActionBuilder.java b/jest-common/src/main/java/io/searchbox/action/AbstractMultiINodeActionBuilder.java
index 35bedc20..1d693c2b 100644
--- a/jest-common/src/main/java/io/searchbox/action/AbstractMultiINodeActionBuilder.java
+++ b/jest-common/src/main/java/io/searchbox/action/AbstractMultiINodeActionBuilder.java
@@ -33,9 +33,7 @@ public abstract class AbstractMultiINodeActionBuilder<T extends Action, K> exten
      * </pre>
      */
     public K addNode(String node) {
-        if (StringUtils.isNotEmpty(node)) {
-            nodes.add(node);
-        }
+        nodes.add(node);
         return (K) this;
     }
 
@@ -65,7 +63,7 @@ public abstract class AbstractMultiINodeActionBuilder<T extends Action, K> exten
     }
 
     public String getJoinedNodes() {
-        if (!nodes.isEmpty()) {
+        if (nodes.size() > 0) {
             return StringUtils.join(nodes, ",");
         } else {
             return "_all";
diff --git a/jest-common/src/main/java/io/searchbox/annotations/JestVersion.java b/jest-common/src/main/java/io/searchbox/annotations/JestVersion.java
deleted file mode 100644
index 86e3cc5a..00000000
--- a/jest-common/src/main/java/io/searchbox/annotations/JestVersion.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package io.searchbox.annotations;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * @author Sebastian Hilbig
- */
-
-
-@Target(value = ElementType.FIELD)
-@Retention(RetentionPolicy.RUNTIME)
-public @interface JestVersion {
-}
diff --git a/jest-common/src/main/java/io/searchbox/client/JestResult.java b/jest-common/src/main/java/io/searchbox/client/JestResult.java
index 83e4b79a..002fb71e 100644
--- a/jest-common/src/main/java/io/searchbox/client/JestResult.java
+++ b/jest-common/src/main/java/io/searchbox/client/JestResult.java
@@ -1,18 +1,11 @@
 package io.searchbox.client;
 
-import com.google.common.collect.ImmutableList;
-import com.google.gson.Gson;
-import com.google.gson.JsonElement;
-import com.google.gson.JsonObject;
-import com.google.gson.JsonParser;
+import com.google.gson.*;
 import io.searchbox.annotations.JestId;
-import io.searchbox.annotations.JestVersion;
-import io.searchbox.cloning.CloneUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.lang.annotation.Annotation;
 import java.lang.reflect.Field;
 import java.math.BigDecimal;
 import java.math.BigInteger;
@@ -26,26 +19,8 @@ import java.util.Map;
 public class JestResult {
 
     public static final String ES_METADATA_ID = "es_metadata_id";
-    public static final String ES_METADATA_VERSION = "es_metadata_version";
     private static final Logger log = LoggerFactory.getLogger(JestResult.class);
 
-    protected static class MetaField {
-        public final String internalFieldName;
-        public final String esFieldName;
-        public final Class<? extends Annotation> annotationClass;
-
-        MetaField(String internalFieldName, String esFieldName, Class<? extends Annotation> annotationClass) {
-            this.internalFieldName = internalFieldName;
-            this.esFieldName = esFieldName;
-            this.annotationClass = annotationClass;
-        }
-    }
-
-    protected static final ImmutableList<MetaField> META_FIELDS = ImmutableList.of(
-            new MetaField(ES_METADATA_ID, "_id", JestId.class),
-            new MetaField(ES_METADATA_VERSION, "_version", JestVersion.class)
-    );
-
     protected JsonObject jsonObject;
     protected String jsonString;
     protected String pathToResult;
@@ -199,7 +174,7 @@ public class JestResult {
         return extractSource(true);
     }
 
-    protected List<JsonElement> extractSource(boolean addEsMetadataFields) {
+    protected List<JsonElement> extractSource(boolean addEsMetadataIdField) {
         List<JsonElement> sourceList = new ArrayList<JsonElement>();
 
         if (jsonObject != null) {
@@ -225,11 +200,9 @@ public class JestResult {
                                 JsonObject currentObj = element.getAsJsonObject();
                                 JsonObject source = currentObj.getAsJsonObject(sourceKey);
                                 if (source != null) {
-                                    JsonObject copy = (JsonObject) CloneUtils.deepClone(source);
-                                    if (addEsMetadataFields) {
-                                        for (MetaField metaField : META_FIELDS) {
-                                            copy.add(metaField.internalFieldName, currentObj.get(metaField.esFieldName));
-                                        }
+                                    JsonObject copy = GsonUtils.deepCopy(source);
+                                    if (addEsMetadataIdField) {
+                                        copy.add(ES_METADATA_ID, currentObj.get("_id"));
                                     }
                                     sourceList.add(copy);
                                 }
@@ -237,15 +210,10 @@ public class JestResult {
                         }
                     }
                 } else if (obj != null) {
-                    JsonElement copy = CloneUtils.deepClone(obj);
-                    if (addEsMetadataFields && copy.isJsonObject()) {
-                        JsonObject copyObject = copy.getAsJsonObject();
-                        for (MetaField metaField : META_FIELDS) {
-                            JsonElement metaElement = jsonObject.get(metaField.esFieldName);
-                            if (metaElement != null) {
-                                copyObject.add(metaField.internalFieldName, metaElement);
-                            }
-                        }
+                    JsonElement copy = GsonUtils.deepCopy(obj);
+                    JsonElement objId = jsonObject.get("_id");
+                    if ((objId != null) && copy.isJsonObject() && addEsMetadataIdField) {
+                        copy.getAsJsonObject().add(ES_METADATA_ID, objId);
                     }
                     sourceList.add(copy);
                 }
@@ -264,16 +232,20 @@ public class JestResult {
 
             // Check if JestId is visible
             Field[] fields = type.getDeclaredFields();
-            int knownMetadataFieldsCount = META_FIELDS.size();
-            int foundFieldsCount = 0;
             for (Field field : fields) {
-                if (foundFieldsCount == knownMetadataFieldsCount) {
-                    break;
-                }
-                for (MetaField metaField : META_FIELDS) {
-                    if (field.isAnnotationPresent(metaField.annotationClass) && setAnnotatedField(obj, source, field, metaField.internalFieldName)) {
-                        foundFieldsCount++;
+                if (field.isAnnotationPresent(JestId.class)) {
+                    try {
+                        field.setAccessible(true);
+                        Object value = field.get(obj);
+                        if (value == null) {
+                            Class<?> fieldType = field.getType();
+                            JsonElement id = ((JsonObject) source).get(ES_METADATA_ID);
+                            field.set(obj, getAs(id, fieldType));
+                        }
+                    } catch (IllegalAccessException e) {
+                        log.error("Unhandled exception occurred while getting annotated id from source");
                     }
+                    break;
                 }
             }
 
@@ -283,22 +255,6 @@ public class JestResult {
         return obj;
     }
 
-    private <T> boolean setAnnotatedField(T obj, JsonElement source, Field field, String fieldName) {
-        try {
-            field.setAccessible(true);
-            Object value = field.get(obj);
-            if (value == null) {
-                Class<?> fieldType = field.getType();
-                JsonElement element = ((JsonObject) source).get(fieldName);
-                field.set(obj, getAs(element, fieldType));
-                return true;
-            }
-        } catch (IllegalAccessException e) {
-            log.error("Unhandled exception occurred while setting annotated field from source");
-        }
-        return false;
-    }
-
     @SuppressWarnings("unchecked")
     private <T> T getAs(JsonElement id, Class<T> fieldType) throws IllegalAccessException {
         if (id.isJsonNull()) {
diff --git a/jest-common/src/main/java/io/searchbox/client/config/ClientConfig.java b/jest-common/src/main/java/io/searchbox/client/config/ClientConfig.java
index d5e9a729..684f945a 100644
--- a/jest-common/src/main/java/io/searchbox/client/config/ClientConfig.java
+++ b/jest-common/src/main/java/io/searchbox/client/config/ClientConfig.java
@@ -18,7 +18,6 @@ public class ClientConfig {
     private Set<String> serverList;
     private boolean isMultiThreaded;
     private boolean isDiscoveryEnabled;
-    private String discoveryFilter;
     private boolean isRequestCompressionEnabled;
     private int connTimeout;
     private int readTimeout;
@@ -37,7 +36,6 @@ public class ClientConfig {
         this.serverList = builder.serverList;
         this.isMultiThreaded = builder.isMultiThreaded;
         this.isDiscoveryEnabled = builder.isDiscoveryEnabled;
-        this.discoveryFilter = builder.discoveryFilter;
         this.isRequestCompressionEnabled = builder.isRequestCompressionEnabled;
         this.discoveryFrequency = builder.discoveryFrequency;
         this.discoveryFrequencyTimeUnit = builder.discoveryFrequencyTimeUnit;
@@ -61,10 +59,6 @@ public class ClientConfig {
         return isDiscoveryEnabled;
     }
 
-    public String getDiscoveryFilter() {
-        return discoveryFilter;
-    }
-
     public Long getDiscoveryFrequency() {
         return discoveryFrequency;
     }
@@ -128,7 +122,6 @@ public class ClientConfig {
                 .append(isDiscoveryEnabled)
                 .append(isRequestCompressionEnabled)
                 .append(discoveryFrequency)
-                .append(discoveryFilter)
                 .append(connTimeout)
                 .append(readTimeout)
                 .append(discoveryFrequencyTimeUnit)
@@ -158,7 +151,6 @@ public class ClientConfig {
                 .append(isDiscoveryEnabled, rhs.isDiscoveryEnabled)
                 .append(isRequestCompressionEnabled, rhs.isRequestCompressionEnabled)
                 .append(discoveryFrequency, rhs.discoveryFrequency)
-                .append(discoveryFilter, rhs.discoveryFilter)
                 .append(connTimeout, rhs.connTimeout)
                 .append(readTimeout, rhs.readTimeout)
                 .append(discoveryFrequencyTimeUnit, rhs.discoveryFrequencyTimeUnit)
@@ -169,11 +161,10 @@ public class ClientConfig {
                 .isEquals();
     }
 
-    protected static abstract class AbstractBuilder<T extends ClientConfig, K extends AbstractBuilder<T, K>> {
+    protected static abstract class AbstractBuilder<T extends ClientConfig, K extends AbstractBuilder> {
         protected Set<String> serverList = new LinkedHashSet<String>();
         protected boolean isMultiThreaded;
         protected boolean isDiscoveryEnabled;
-        protected String discoveryFilter;
         protected boolean isRequestCompressionEnabled;
         protected long discoveryFrequency = 10L;
         protected long maxConnectionIdleTime = -1L;
@@ -199,7 +190,6 @@ public class ClientConfig {
             this.isMultiThreaded = clientConfig.isMultiThreaded;
             this.isDiscoveryEnabled = clientConfig.isDiscoveryEnabled;
             this.discoveryFrequency = clientConfig.discoveryFrequency;
-            this.discoveryFilter = clientConfig.discoveryFilter;
             this.discoveryFrequencyTimeUnit = clientConfig.discoveryFrequencyTimeUnit;
             this.connTimeout = clientConfig.connTimeout;
             this.readTimeout = clientConfig.readTimeout;
@@ -232,11 +222,6 @@ public class ClientConfig {
             return (K) this;
         }
 
-        public K discoveryFilter(String discoveryFilter) {
-            this.discoveryFilter = discoveryFilter;
-            return (K) this;
-        }
-
         public K multiThreaded(boolean isMultiThreaded) {
             this.isMultiThreaded = isMultiThreaded;
             return (K) this;
diff --git a/jest-common/src/main/java/io/searchbox/client/config/discovery/NodeChecker.java b/jest-common/src/main/java/io/searchbox/client/config/discovery/NodeChecker.java
index efead34a..1af8270a 100644
--- a/jest-common/src/main/java/io/searchbox/client/config/discovery/NodeChecker.java
+++ b/jest-common/src/main/java/io/searchbox/client/config/discovery/NodeChecker.java
@@ -6,22 +6,21 @@ import com.google.common.util.concurrent.MoreExecutors;
 import com.google.common.util.concurrent.ThreadFactoryBuilder;
 import com.google.gson.JsonElement;
 import com.google.gson.JsonObject;
-
 import io.searchbox.client.JestClient;
 import io.searchbox.client.JestResult;
 import io.searchbox.client.config.ClientConfig;
-import io.searchbox.client.config.exception.CouldNotConnectException;
 import io.searchbox.cluster.NodesInfo;
-
 import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.ThreadFactory;
 import java.util.LinkedHashSet;
 import java.util.Map.Entry;
 import java.util.Set;
-import java.util.concurrent.Executors;
-import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.TimeUnit;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
@@ -36,27 +35,27 @@ public class NodeChecker extends AbstractScheduledService {
     private final static String PUBLISH_ADDRESS_KEY = "http_address";
     private final static Pattern INETSOCKETADDRESS_PATTERN = Pattern.compile("(?:inet\\[)?(?:(?:[^:]+)?\\/)?([^:]+):(\\d+)\\]?");
 
-    private final NodesInfo action;
+    private final NodesInfo action = new NodesInfo.Builder().withHttp().build();
 
     protected JestClient client;
     protected Scheduler scheduler;
     protected String defaultScheme;
     protected Set<String> bootstrapServerList;
-    protected Set<String> discoveredServerList;
 
     public NodeChecker(JestClient jestClient, ClientConfig clientConfig) {
-        action = new NodesInfo.Builder()
-                .withHttp()
-                .addNode(clientConfig.getDiscoveryFilter())
-                .build();
+        this(jestClient, clientConfig.getDefaultSchemeForDiscoveredNodes(), clientConfig.getDiscoveryFrequency(), clientConfig.getDiscoveryFrequencyTimeUnit(),
+				clientConfig.getServerList());
+    }
+
+    public NodeChecker(JestClient jestClient, String defaultScheme, Long discoveryFrequency, TimeUnit discoveryFrequencyTimeUnit, Set<String> servers) {
         this.client = jestClient;
-        this.defaultScheme = clientConfig.getDefaultSchemeForDiscoveredNodes();
+        this.defaultScheme = defaultScheme;
         this.scheduler = Scheduler.newFixedDelaySchedule(
                 0l,
-                clientConfig.getDiscoveryFrequency(),
-                clientConfig.getDiscoveryFrequencyTimeUnit()
+                discoveryFrequency,
+                discoveryFrequencyTimeUnit
         );
-		this.bootstrapServerList = ImmutableSet.copyOf(clientConfig.getServerList());
+		this.bootstrapServerList = ImmutableSet.copyOf(servers);
     }
 
     @Override
@@ -64,20 +63,13 @@ public class NodeChecker extends AbstractScheduledService {
         JestResult result;
         try {
             result = client.execute(action);
-        } catch (CouldNotConnectException cnce) {
-            // Can't connect to this node, remove it from the list
-            log.error("Connect exception executing NodesInfo!", cnce);
-            removeNodeAndUpdateServers(cnce.getHost());
-            return;
-            // do not elevate the exception since that will stop the scheduled calls.
-            // throw new RuntimeException("Error executing NodesInfo!", e);
         } catch (Exception e) {
             log.error("Error executing NodesInfo!", e);
             client.setServers(bootstrapServerList);
             return;
             // do not elevate the exception since that will stop the scheduled calls.
             // throw new RuntimeException("Error executing NodesInfo!", e);
-        }  
+        }
 
         if (result.isSucceeded()) {
             LinkedHashSet<String> httpHosts = new LinkedHashSet<String>();
@@ -101,27 +93,13 @@ public class NodeChecker extends AbstractScheduledService {
             if (log.isDebugEnabled()) {
                 log.debug("Discovered {} HTTP hosts: {}", httpHosts.size(), StringUtils.join(httpHosts, ","));
             }
-            discoveredServerList = httpHosts;
-            client.setServers(discoveredServerList);
+            client.setServers(httpHosts);
         } else {
             log.warn("NodesInfo request resulted in error: {}", result.getErrorMessage());
             client.setServers(bootstrapServerList);
         }
     }
 
-    protected void removeNodeAndUpdateServers(final String hostToRemove) {
-        log.warn("Removing host {}", hostToRemove);
-        discoveredServerList.remove(hostToRemove);
-        if (log.isInfoEnabled()) {
-            log.info("Discovered server pool is now: {}", StringUtils.join(discoveredServerList, ","));
-        }
-        if (!discoveredServerList.isEmpty()) {
-          client.setServers(discoveredServerList);
-        } else {
-          client.setServers(bootstrapServerList);
-        }
-    }
-
     @Override
     protected Scheduler scheduler() {
         return scheduler;
diff --git a/jest-common/src/main/java/io/searchbox/client/config/exception/CouldNotConnectException.java b/jest-common/src/main/java/io/searchbox/client/config/exception/CouldNotConnectException.java
deleted file mode 100644
index 79db9e64..00000000
--- a/jest-common/src/main/java/io/searchbox/client/config/exception/CouldNotConnectException.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package io.searchbox.client.config.exception;
-
-import java.io.IOException;
-
-/**
- * Wrapper for a the host address of an HTTPConnectException
- * @author Brian Harrington
- */
-public class CouldNotConnectException extends IOException {
-
-    private final String host;
-
-    public CouldNotConnectException(String host, Throwable cause) {
-        super("Could not connect to " + host, cause);
-        this.host = host;
-    }
-
-    public String getHost() {
-        return host;
-    }
-}
diff --git a/jest-common/src/main/java/io/searchbox/cloning/CloneUtils.java b/jest-common/src/main/java/io/searchbox/cloning/CloneUtils.java
deleted file mode 100644
index 151a9788..00000000
--- a/jest-common/src/main/java/io/searchbox/cloning/CloneUtils.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package io.searchbox.cloning;
-
-import com.google.gson.*;
-
-import java.util.Map;
-
-/**
- * This class is just a workaround for the non-public deepCopy methods in Gson.
- */
-public class CloneUtils {
-    public static JsonElement deepClone(JsonElement jsonElement) {
-        if (jsonElement instanceof JsonObject) {
-            return deepCloneObject(jsonElement);
-        } else if (jsonElement instanceof JsonArray) {
-            return deepCloneArray(jsonElement);
-        } else if (jsonElement instanceof JsonPrimitive) {
-            return jsonElement;
-        }
-
-        return JsonNull.INSTANCE;
-    }
-
-    private static JsonElement deepCloneObject(JsonElement jsonElement) {
-        JsonObject jsonObject = (JsonObject) jsonElement;
-        JsonObject result = new JsonObject();
-
-        for (Map.Entry<String, JsonElement> entry : jsonObject.entrySet()) {
-            result.add(entry.getKey(), deepClone(entry.getValue()));
-        }
-
-        return result;
-    }
-
-    private static JsonElement deepCloneArray(JsonElement jsonElement) {
-        JsonArray jsonArray = (JsonArray) jsonElement;
-        JsonArray result = new JsonArray();
-
-        for (JsonElement element : jsonArray) {
-            result.add(deepClone(element));
-        }
-
-        return result;
-    }
-}
diff --git a/jest-common/src/main/java/io/searchbox/core/BulkResult.java b/jest-common/src/main/java/io/searchbox/core/BulkResult.java
index 12f82b3e..23840f27 100644
--- a/jest-common/src/main/java/io/searchbox/core/BulkResult.java
+++ b/jest-common/src/main/java/io/searchbox/core/BulkResult.java
@@ -93,7 +93,7 @@ public class BulkResult extends JestResult {
             this.operation = operation;
             this.index = values.get("_index").getAsString();
             this.type = values.get("_type").getAsString();
-            this.id = values.has("_id") && !values.get("_id").isJsonNull() ? values.get("_id").getAsString() : null;
+            this.id = values.get("_id").getAsString();
             this.status = values.get("status").getAsInt();
             this.error = values.has("error") ? values.get("error").toString() : null;
         }
diff --git a/jest-common/src/main/java/io/searchbox/core/ClearScroll.java b/jest-common/src/main/java/io/searchbox/core/ClearScroll.java
deleted file mode 100644
index 1baaef1b..00000000
--- a/jest-common/src/main/java/io/searchbox/core/ClearScroll.java
+++ /dev/null
@@ -1,62 +0,0 @@
-package io.searchbox.core;
-
-import com.google.common.collect.ImmutableMap;
-import io.searchbox.action.GenericResultAbstractAction;
-
-import java.util.Collection;
-import java.util.LinkedHashSet;
-import java.util.Set;
-
-
-public class ClearScroll extends GenericResultAbstractAction {
-
-  private final String uri;
-
-  public ClearScroll(Builder builder) {
-
-    if (builder.getScrollIds().size() == 0) {
-      uri = "/_search/scroll/_all";
-      this.payload = null;
-    } else {
-      uri = "/_search/scroll";
-      this.payload = ImmutableMap.of("scroll_id", builder.getScrollIds());
-    }
-
-    setURI(buildURI());
-  }
-
-  @Override
-  public String getRestMethodName() {
-    return "DELETE";
-  }
-
-  @Override
-  protected String buildURI() {
-    return super.buildURI() + uri;
-  }
-
-  public static class Builder extends GenericResultAbstractAction.Builder<ClearScroll, Builder> {
-
-    protected Collection<String> scrollIds = new LinkedHashSet<String>();
-
-    public Builder addScrollId(String scrollId) {
-      this.scrollIds.add(scrollId);
-      return this;
-    }
-
-    public Builder addScrollIds(Set<String> scrollIds) {
-      this.scrollIds.addAll(scrollIds);
-      return this;
-    }
-
-    @Override
-    public ClearScroll build() {
-      return new ClearScroll(this);
-    }
-
-    public Collection<String> getScrollIds() {
-      return scrollIds;
-    }
-
-  }
-}
diff --git a/jest-common/src/main/java/io/searchbox/core/Doc.java b/jest-common/src/main/java/io/searchbox/core/Doc.java
index 0eb029e1..8c653cb9 100644
--- a/jest-common/src/main/java/io/searchbox/core/Doc.java
+++ b/jest-common/src/main/java/io/searchbox/core/Doc.java
@@ -24,13 +24,22 @@ public class Doc {
 
     private final Collection<String> fields = new LinkedList<String>();
 
+    public Doc(String index, String id) {
+        this(index, null, id);
+    }
+
+    /**
+     *
+     * @param index
+     * @param type
+     *          The mget API allows for _type to be optional.
+     *          Set it to _all or null in order to fetch the first document matching the id across all types.
+     * @param id
+     */
     public Doc(String index, String type, String id) {
         if(StringUtils.isEmpty(index)){
             throw new IllegalArgumentException("Required Index argument cannot be null or empty.");
         }
-        if(StringUtils.isEmpty(type)){
-            throw new IllegalArgumentException("Required Type argument cannot be null or empty.");
-        }
         if(StringUtils.isEmpty(id)){
             throw new IllegalArgumentException("Required Id argument cannot be null or empty.");
         }
@@ -100,7 +109,11 @@ public class Doc {
         Map<String, Object> retval = new LinkedHashMap<String, Object>();
 
         retval.put("_index", index);
-        retval.put("_type", type);
+
+        if(StringUtils.isNotEmpty(type)) {
+            retval.put("_type", type);
+        }
+
         retval.put("_id", id);
 
         if(!fields.isEmpty()) {
diff --git a/jest-common/src/main/java/io/searchbox/core/DocumentResult.java b/jest-common/src/main/java/io/searchbox/core/DocumentResult.java
index 3ff14b8f..dee5578c 100644
--- a/jest-common/src/main/java/io/searchbox/core/DocumentResult.java
+++ b/jest-common/src/main/java/io/searchbox/core/DocumentResult.java
@@ -24,9 +24,6 @@ public class DocumentResult extends JestResult {
         return getAsString(jsonObject.get("_id"));
     }
 
-    public Long getVersion() {
-        return getAsLong(jsonObject.get("_version"));
-    }
 
     private String getAsString(JsonElement jsonElement) {
         if(jsonElement == null) {
@@ -35,13 +32,4 @@ public class DocumentResult extends JestResult {
             return jsonElement.getAsString();
         }
     }
-
-    private Long getAsLong(JsonElement jsonElement) {
-        if(jsonElement == null) {
-            return null;
-        } else {
-            return jsonElement.getAsLong();
-        }
-    }
-
 }
diff --git a/jest-common/src/main/java/io/searchbox/core/MultiGet.java b/jest-common/src/main/java/io/searchbox/core/MultiGet.java
index 87f491bd..78674b43 100644
--- a/jest-common/src/main/java/io/searchbox/core/MultiGet.java
+++ b/jest-common/src/main/java/io/searchbox/core/MultiGet.java
@@ -118,6 +118,11 @@ public class MultiGet extends GenericResultAbstractAction {
         public static class ByDoc extends GenericResultAbstractAction.Builder<MultiGet, ByDoc> {
             private List<Doc> docs = new LinkedList<Doc>();
 
+            /**
+             * The mget API allows for _type to be optional. Set it to _all or leave it empty in order to
+             * fetch the first document matching the id across all types. If you don’t set the type and
+             * have many documents sharing the same _id, you will end up getting only the first matching document.
+             */
             public ByDoc(Collection<? extends Doc> docs) {
                 this.docs.addAll(docs);
             }
diff --git a/jest-common/src/main/java/io/searchbox/core/Search.java b/jest-common/src/main/java/io/searchbox/core/Search.java
index f7553bbf..dfea8834 100644
--- a/jest-common/src/main/java/io/searchbox/core/Search.java
+++ b/jest-common/src/main/java/io/searchbox/core/Search.java
@@ -120,6 +120,10 @@ public class Search extends AbstractAction<SearchResult> {
     public static class Builder extends AbstractMultiTypeActionBuilder<Search, Builder> {
         protected String query;
         protected List<Sort> sortList = new LinkedList<Sort>();
+        
+        protected Builder() {
+        	
+        }
 
         public Builder(String query) {
             this.query = query;
@@ -144,19 +148,12 @@ public class Search extends AbstractAction<SearchResult> {
             return new Search(this);
         }
     }
-
-    public static class VersionBuilder extends Builder {
-        public VersionBuilder(String query) {
-            super(query);
-            this.setParameter(Parameters.VERSION, "true");
-        }
-    }
-
-    public static class TemplateBuilder extends Builder {
+    
+    public static class TemplateBuilder extends Builder {    	
     	public TemplateBuilder(String templatedQuery) {    		
-            super(templatedQuery);
+            super.query = templatedQuery;
         }
-
+    	
     	@Override
         public Search build() {
             return new Search(this);
diff --git a/jest-common/src/main/java/io/searchbox/core/SearchResult.java b/jest-common/src/main/java/io/searchbox/core/SearchResult.java
index 429022d7..70cb117a 100644
--- a/jest-common/src/main/java/io/searchbox/core/SearchResult.java
+++ b/jest-common/src/main/java/io/searchbox/core/SearchResult.java
@@ -1,11 +1,7 @@
 package io.searchbox.core;
 
-import com.google.gson.Gson;
-import com.google.gson.JsonArray;
-import com.google.gson.JsonElement;
-import com.google.gson.JsonObject;
+import com.google.gson.*;
 import io.searchbox.client.JestResult;
-import io.searchbox.cloning.CloneUtils;
 import io.searchbox.core.search.aggregation.MetricAggregation;
 import io.searchbox.core.search.aggregation.RootAggregation;
 import org.apache.commons.lang3.builder.EqualsBuilder;
@@ -101,6 +97,7 @@ public class SearchResult extends JestResult {
             JsonObject source = hitObject.getAsJsonObject(sourceKey);
 
             if (source != null) {
+                JsonElement id = hitObject.get("_id");
                 String index = hitObject.get("_index").getAsString();
                 String type = hitObject.get("_type").getAsString();
 
@@ -113,20 +110,10 @@ public class SearchResult extends JestResult {
                 Map<String, List<String>> highlight = extractHighlight(hitObject.getAsJsonObject(HIGHLIGHT_KEY));
                 List<String> sort = extractSort(hitObject.getAsJsonArray(SORT_KEY));
 
-                JsonObject clonedSource = null;
-                for (MetaField metaField : META_FIELDS) {
-                    JsonElement metaElement = hitObject.get(metaField.esFieldName);
-                    if (metaElement != null) {
-                        if (clonedSource == null) {
-                            clonedSource = (JsonObject) CloneUtils.deepClone(source);
-                        }
-                        clonedSource.add(metaField.internalFieldName, metaElement);
-                    }
-                }
-                if (clonedSource != null) {
-                    source = clonedSource;
+                if (id != null) {
+                    source = GsonUtils.deepCopy(source);
+                    source.add(ES_METADATA_ID, id);
                 }
-
                 hit = new Hit<T, K>(
                         sourceType,
                         source,
diff --git a/jest-common/src/main/java/io/searchbox/core/Update.java b/jest-common/src/main/java/io/searchbox/core/Update.java
index b973a6ff..583b8bcd 100644
--- a/jest-common/src/main/java/io/searchbox/core/Update.java
+++ b/jest-common/src/main/java/io/searchbox/core/Update.java
@@ -2,7 +2,6 @@ package io.searchbox.core;
 
 import io.searchbox.action.BulkableAction;
 import io.searchbox.action.SingleResultAbstractDocumentTargetedAction;
-import io.searchbox.params.Parameters;
 import org.apache.commons.lang3.builder.EqualsBuilder;
 import org.apache.commons.lang3.builder.HashCodeBuilder;
 
@@ -75,10 +74,4 @@ public class Update extends SingleResultAbstractDocumentTargetedAction implement
         }
     }
 
-    public static class VersionBuilder extends Builder {
-        public VersionBuilder(Object payload, Long version) {
-            super(payload);
-            this.setParameter(Parameters.VERSION, version);
-        }
-    }
 }
diff --git a/jest-common/src/main/java/io/searchbox/core/search/aggregation/MetricAggregation.java b/jest-common/src/main/java/io/searchbox/core/search/aggregation/MetricAggregation.java
index d5e8a3b6..fa9d3394 100644
--- a/jest-common/src/main/java/io/searchbox/core/search/aggregation/MetricAggregation.java
+++ b/jest-common/src/main/java/io/searchbox/core/search/aggregation/MetricAggregation.java
@@ -247,9 +247,5 @@ public abstract class MetricAggregation extends Aggregation {
     public ValueCountAggregation getValueCountAggregation(String aggName) {
         return jsonRoot.has(aggName) ? new ValueCountAggregation(aggName, jsonRoot.getAsJsonObject(aggName)) : null;
     }
-    
-    public TopHitsAggregation getTopHitsAggregation(String aggName) {
-	return jsonRoot.has(aggName) ? new TopHitsAggregation(aggName, jsonRoot.getAsJsonObject(aggName)) : null;
-    }
 
 }
diff --git a/jest-common/src/main/java/io/searchbox/core/search/aggregation/TopHitsAggregation.java b/jest-common/src/main/java/io/searchbox/core/search/aggregation/TopHitsAggregation.java
deleted file mode 100644
index 83344b3c..00000000
--- a/jest-common/src/main/java/io/searchbox/core/search/aggregation/TopHitsAggregation.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package io.searchbox.core.search.aggregation;
-
-import java.util.List;
-
-import com.google.gson.Gson;
-import com.google.gson.JsonObject;
-
-import io.searchbox.core.SearchResult;
-
-public class TopHitsAggregation extends SearchResult {
-
-    protected String name;
-    protected JsonObject jsonRoot;
-    public static final String TYPE = "top_hits";
-
-    public TopHitsAggregation(String name, JsonObject topHitAggregation) {
-	super(new Gson());
-	this.name = name;
-	
-	this.setSucceeded(true);
-	this.setJsonObject(topHitAggregation);
-	//this.setJsonString(topHitAggregation.getAsString());
-	this.setPathToResult("hits/hits/_source");
-    }
-
-    public String getName() {
-	return name;
-    }
-}
diff --git a/jest-common/src/main/java/io/searchbox/snapshot/AbstractSnapshotAction.java b/jest-common/src/main/java/io/searchbox/snapshot/AbstractSnapshotAction.java
deleted file mode 100644
index fd3eeda5..00000000
--- a/jest-common/src/main/java/io/searchbox/snapshot/AbstractSnapshotAction.java
+++ /dev/null
@@ -1,82 +0,0 @@
-package io.searchbox.snapshot;
-
-import io.searchbox.action.GenericResultAbstractAction;
-import org.apache.commons.lang3.StringUtils;
-
-import java.util.Collection;
-import java.util.LinkedHashSet;
-import java.util.Set;
-
-/**
- * @author ckeser
- */
-public abstract class AbstractSnapshotAction extends GenericResultAbstractAction {
-
-    private String repository;
-    private String snapshots;
-
-    protected AbstractSnapshotAction(SnapshotBuilder builder) {
-        super(builder);
-
-        this.repository = builder.repository;
-        this.snapshots = builder.getSnapshots();
-        setURI(buildURI());
-    }
-
-    @Override
-    protected String buildURI() {
-        return super.buildURI() + "/_snapshot/" + repository + "/" + snapshots;
-    }
-
-    public abstract static class SnapshotBuilder<T extends AbstractSnapshotAction, K> extends Builder<T, K> {
-        protected String repository;
-
-        protected SnapshotBuilder(String repository) {
-            this.repository = repository;
-        }
-
-        protected abstract String getSnapshots();
-    }
-
-    public abstract static class SingleSnapshotBuilder<T extends AbstractSnapshotAction, K> extends SnapshotBuilder<T, K> {
-        private String snapshot;
-
-        public SingleSnapshotBuilder(String repository, String snapshot) {
-            super(repository);
-            this.snapshot = snapshot;
-        }
-
-        @Override
-        protected String getSnapshots() {
-            return snapshot;
-        }
-    }
-
-    @SuppressWarnings("unchecked")
-    public abstract static class MultipleSnapshotBuilder<T extends AbstractSnapshotAction, K> extends SnapshotBuilder<T, K> {
-        private Set<String> snapshots = new LinkedHashSet<String>();
-
-        public MultipleSnapshotBuilder(String repository) {
-            super(repository);
-        }
-
-        public K addSnapshot(Collection<? extends String> snapshots) {
-            this.snapshots.addAll(snapshots);
-            return (K) this;
-        }
-
-        public K addSnapshot(String snapshot) {
-            this.snapshots.add(snapshot);
-            return (K) this;
-        }
-
-        @Override
-        protected String getSnapshots() {
-            if (snapshots.isEmpty()) {
-                return "_all";
-            } else {
-                return StringUtils.join(snapshots, ",");
-            }
-        }
-    }
-}
diff --git a/jest-common/src/main/java/io/searchbox/snapshot/AbstractSnapshotRepositoryAction.java b/jest-common/src/main/java/io/searchbox/snapshot/AbstractSnapshotRepositoryAction.java
deleted file mode 100644
index 6d8e67d3..00000000
--- a/jest-common/src/main/java/io/searchbox/snapshot/AbstractSnapshotRepositoryAction.java
+++ /dev/null
@@ -1,39 +0,0 @@
-package io.searchbox.snapshot;
-
-import io.searchbox.action.GenericResultAbstractAction;
-
-/**
- * @author ckeser
- */
-public abstract class AbstractSnapshotRepositoryAction extends GenericResultAbstractAction {
-
-    private String repositories;
-
-    protected AbstractSnapshotRepositoryAction(RepositoryBuilder builder) {
-        super(builder);
-
-        this.repositories = builder.getRepositories();
-        setURI(buildURI());
-    }
-
-    @Override
-    protected String buildURI() {
-        return super.buildURI() + "/_snapshot/" + repositories;
-    }
-
-    public abstract static class RepositoryBuilder<T extends AbstractSnapshotRepositoryAction, K> extends Builder<T, K> {
-        protected abstract String getRepositories();
-    }
-
-    public abstract static class SingleRepositoryBuilder<T extends AbstractSnapshotRepositoryAction, K> extends RepositoryBuilder<T, K> {
-        private String repository;
-
-        public SingleRepositoryBuilder(String repository) {
-            this.repository = repository;
-        }
-
-        protected String getRepositories() {
-            return repository;
-        }
-    }
-}
diff --git a/jest-common/src/main/java/io/searchbox/snapshot/CreateSnapshot.java b/jest-common/src/main/java/io/searchbox/snapshot/CreateSnapshot.java
deleted file mode 100644
index 4340decd..00000000
--- a/jest-common/src/main/java/io/searchbox/snapshot/CreateSnapshot.java
+++ /dev/null
@@ -1,39 +0,0 @@
-package io.searchbox.snapshot;
-
-/**
- * @author happyprg(hongsgo@gmail.com)
- */
-public class CreateSnapshot extends AbstractSnapshotAction {
-
-    protected CreateSnapshot(Builder builder) {
-        super(builder);
-        this.payload = builder.settings;
-    }
-
-    @Override
-    public String getRestMethodName() {
-        return "PUT";
-    }
-
-    public static class Builder extends AbstractSnapshotAction.SingleSnapshotBuilder<CreateSnapshot, Builder> {
-        private Object settings;
-
-        public Builder(String repository, String snapshot) {
-            super(repository, snapshot);
-        }
-
-        public Builder settings(Object settings) {
-            this.settings = settings;
-            return this;
-        }
-
-        public Builder waitForCompletion(boolean waitForCompletion) {
-            return setParameter("wait_for_completion", waitForCompletion);
-        }
-
-        @Override
-        public CreateSnapshot build() {
-            return new CreateSnapshot(this);
-        }
-    }
-}
diff --git a/jest-common/src/main/java/io/searchbox/snapshot/CreateSnapshotRepository.java b/jest-common/src/main/java/io/searchbox/snapshot/CreateSnapshotRepository.java
deleted file mode 100644
index 76364665..00000000
--- a/jest-common/src/main/java/io/searchbox/snapshot/CreateSnapshotRepository.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package io.searchbox.snapshot;
-
-/**
- * @author happyprg(hongsgo@gmail.com)
- */
-public class CreateSnapshotRepository extends AbstractSnapshotRepositoryAction {
-
-    protected CreateSnapshotRepository(Builder builder) {
-        super(builder);
-
-        this.payload = builder.settings;
-    }
-
-    @Override
-    public String getRestMethodName() {
-        return "PUT";
-    }
-
-    public static class Builder extends AbstractSnapshotRepositoryAction.SingleRepositoryBuilder<CreateSnapshotRepository, Builder> {
-        private Object settings;
-
-        public Builder(String repository) {
-            super(repository);
-        }
-
-        public Builder settings(Object settings) {
-            this.settings = settings;
-            return this;
-        }
-
-        public Builder verify(boolean verify) {
-            return setParameter("verify", verify);
-        }
-
-        @Override
-        public CreateSnapshotRepository build() {
-            return new CreateSnapshotRepository(this);
-        }
-    }
-}
diff --git a/jest-common/src/main/java/io/searchbox/snapshot/DeleteSnapshot.java b/jest-common/src/main/java/io/searchbox/snapshot/DeleteSnapshot.java
deleted file mode 100644
index 85f1956c..00000000
--- a/jest-common/src/main/java/io/searchbox/snapshot/DeleteSnapshot.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package io.searchbox.snapshot;
-
-/**
- * @author happyprg(hongsgo@gmail.com)
- */
-public class DeleteSnapshot extends AbstractSnapshotAction {
-
-    protected DeleteSnapshot(Builder builder) {
-        super(builder);
-    }
-
-    @Override
-    public String getRestMethodName() {
-        return "DELETE";
-    }
-
-    public static class Builder extends AbstractSnapshotAction.SingleSnapshotBuilder<DeleteSnapshot, Builder> {
-        public Builder(String repository, String snapshot) {
-            super(repository, snapshot);
-        }
-
-        @Override
-        public DeleteSnapshot build() {
-            return new DeleteSnapshot(this);
-        }
-    }
-}
diff --git a/jest-common/src/main/java/io/searchbox/snapshot/DeleteSnapshotRepository.java b/jest-common/src/main/java/io/searchbox/snapshot/DeleteSnapshotRepository.java
deleted file mode 100644
index 24f45c23..00000000
--- a/jest-common/src/main/java/io/searchbox/snapshot/DeleteSnapshotRepository.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package io.searchbox.snapshot;
-
-/**
- * @author happyprg(hongsgo@gmail.com)
- */
-public class DeleteSnapshotRepository extends AbstractSnapshotRepositoryAction {
-
-    protected DeleteSnapshotRepository(Builder builder) {
-        super(builder);
-    }
-
-    @Override
-    public String getRestMethodName() {
-        return "DELETE";
-    }
-
-    public static class Builder extends AbstractSnapshotRepositoryAction.SingleRepositoryBuilder<DeleteSnapshotRepository, Builder> {
-        public Builder(String repository) {
-            super(repository);
-        }
-
-        @Override
-        public DeleteSnapshotRepository build() {
-            return new DeleteSnapshotRepository(this);
-        }
-    }
-}
diff --git a/jest-common/src/main/java/io/searchbox/snapshot/GetSnapshot.java b/jest-common/src/main/java/io/searchbox/snapshot/GetSnapshot.java
deleted file mode 100644
index 97047709..00000000
--- a/jest-common/src/main/java/io/searchbox/snapshot/GetSnapshot.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package io.searchbox.snapshot;
-
-/**
- * @author happyprg(hongsgo@gmail.com)
- */
-public class GetSnapshot extends AbstractSnapshotAction {
-
-    protected GetSnapshot(Builder builder) {
-        super(builder);
-    }
-
-    @Override
-    public String getRestMethodName() {
-        return "GET";
-    }
-
-    public static class Builder extends AbstractSnapshotAction.MultipleSnapshotBuilder<GetSnapshot, Builder> {
-
-        public Builder(String repository) {
-            super(repository);
-        }
-
-        @Override
-        public GetSnapshot build() {
-            return new GetSnapshot(this);
-        }
-    }
-}
diff --git a/jest-common/src/main/java/io/searchbox/snapshot/GetSnapshotRepository.java b/jest-common/src/main/java/io/searchbox/snapshot/GetSnapshotRepository.java
deleted file mode 100644
index 02109c72..00000000
--- a/jest-common/src/main/java/io/searchbox/snapshot/GetSnapshotRepository.java
+++ /dev/null
@@ -1,56 +0,0 @@
-package io.searchbox.snapshot;
-
-import org.apache.commons.lang3.StringUtils;
-
-import java.util.Collection;
-import java.util.LinkedHashSet;
-import java.util.Set;
-
-/**
- * @author happyprg(hongsgo@gmail.com)
- */
-public class GetSnapshotRepository extends AbstractSnapshotRepositoryAction {
-
-    protected GetSnapshotRepository(Builder builder) {
-        super(builder);
-    }
-
-    @Override
-    public String getRestMethodName() {
-        return "GET";
-    }
-
-    public static class Builder extends AbstractSnapshotRepositoryAction.RepositoryBuilder<GetSnapshotRepository, Builder> {
-        private Set<String> repositories = new LinkedHashSet<String>();
-
-        public Builder() {
-        }
-
-        public Builder(String repository) {
-            this.repositories.add(repository);
-        }
-
-        public Builder(Collection<? extends String> repositories) {
-            this.repositories.addAll(repositories);
-        }
-
-        public Builder addRepository(Collection<? extends String> repositories) {
-            this.repositories.addAll(repositories);
-            return this;
-        }
-
-        @Override
-        public GetSnapshotRepository build() {
-            return new GetSnapshotRepository(this);
-        }
-
-        @Override
-        protected String getRepositories() {
-            if (repositories.isEmpty()) {
-                return "_all";
-            } else {
-                return StringUtils.join(repositories, ",");
-            }
-        }
-    }
-}
diff --git a/jest-common/src/main/java/io/searchbox/snapshot/RestoreSnapshot.java b/jest-common/src/main/java/io/searchbox/snapshot/RestoreSnapshot.java
deleted file mode 100644
index a4e82e84..00000000
--- a/jest-common/src/main/java/io/searchbox/snapshot/RestoreSnapshot.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package io.searchbox.snapshot;
-
-/**
- * @author happyprg(hongsgo@gmail.com)
- */
-public class RestoreSnapshot extends AbstractSnapshotAction {
-
-    protected RestoreSnapshot(Builder builder) {
-        super(builder);
-        this.payload = builder.settings;
-    }
-
-    @Override
-    protected String buildURI() {
-        return super.buildURI() + "/_restore";
-    }
-
-    @Override
-    public String getRestMethodName() {
-        return "POST";
-    }
-
-    public static class Builder extends AbstractSnapshotAction.SingleSnapshotBuilder<RestoreSnapshot, Builder> {
-        private Object settings;
-
-        public Builder(String repository, String snapshot) {
-            super(repository, snapshot);
-        }
-
-        public Builder settings(Object settings) {
-            this.settings = settings;
-            return this;
-        }
-
-        @Override
-        public RestoreSnapshot build() {
-            return new RestoreSnapshot(this);
-        }
-    }
-}
diff --git a/jest-common/src/main/java/io/searchbox/snapshot/SnapshotStatus.java b/jest-common/src/main/java/io/searchbox/snapshot/SnapshotStatus.java
deleted file mode 100644
index 1b9163c8..00000000
--- a/jest-common/src/main/java/io/searchbox/snapshot/SnapshotStatus.java
+++ /dev/null
@@ -1,32 +0,0 @@
-package io.searchbox.snapshot;
-
-/**
- * @author happyprg(hongsgo@gmail.com)
- */
-public class SnapshotStatus extends AbstractSnapshotAction {
-
-    protected SnapshotStatus(Builder builder) {
-        super(builder);
-    }
-
-    @Override
-    protected String buildURI() {
-        return super.buildURI() + "/_status";
-    }
-
-    @Override
-    public String getRestMethodName() {
-        return "GET";
-    }
-
-    public static class Builder extends AbstractSnapshotAction.MultipleSnapshotBuilder<SnapshotStatus, Builder> {
-        public Builder(String repository) {
-            super(repository);
-        }
-
-        @Override
-        public SnapshotStatus build() {
-            return new SnapshotStatus(this);
-        }
-    }
-}
diff --git a/jest-droid/pom.xml b/jest-droid/pom.xml
index 96189150..6ed6341b 100644
--- a/jest-droid/pom.xml
+++ b/jest-droid/pom.xml
@@ -45,7 +45,7 @@
     <parent>
         <groupId>io.searchbox</groupId>
         <artifactId>jest-parent</artifactId>
-        <version>2.0.4-SNAPSHOT</version>
+        <version>2.0.3-SNAPSHOT</version>
     </parent>
 
     <dependencies>
diff --git a/jest-droid/src/main/java/com/searchly/jestdroid/JestDroidClient.java b/jest-droid/src/main/java/com/searchly/jestdroid/JestDroidClient.java
index b2e44fa0..297a4b9a 100644
--- a/jest-droid/src/main/java/com/searchly/jestdroid/JestDroidClient.java
+++ b/jest-droid/src/main/java/com/searchly/jestdroid/JestDroidClient.java
@@ -8,7 +8,6 @@ import io.searchbox.client.AbstractJestClient;
 import io.searchbox.client.JestClient;
 import io.searchbox.client.JestResult;
 import io.searchbox.client.JestResultHandler;
-import io.searchbox.client.config.exception.CouldNotConnectException;
 import org.apache.http.HttpEntityEnclosingRequest;
 import org.apache.http.HttpResponse;
 import org.apache.http.StatusLine;
@@ -18,7 +17,6 @@ import org.apache.http.client.methods.HttpHeadHC4;
 import org.apache.http.client.methods.HttpPostHC4;
 import org.apache.http.client.methods.HttpPutHC4;
 import org.apache.http.client.methods.HttpUriRequest;
-import org.apache.http.conn.HttpHostConnectException;
 import org.apache.http.entity.ContentType;
 import org.apache.http.util.EntityUtilsHC4;
 import org.slf4j.Logger;
@@ -50,12 +48,9 @@ public class JestDroidClient extends AbstractJestClient implements JestClient {
             }
         }
 
-        try {
-            HttpResponse response = httpClient.execute(request);
-            return deserializeResponse(response, clientRequest);
-        } catch (HttpHostConnectException ex) {
-            throw new CouldNotConnectException(ex.getHost().toURI(), ex);
-        }
+        HttpResponse response = httpClient.execute(request);
+
+        return deserializeResponse(response, clientRequest);
     }
 
     @Override
diff --git a/jest/README.md b/jest/README.md
index dc3bc1bd..a711d947 100644
--- a/jest/README.md
+++ b/jest/README.md
@@ -253,25 +253,6 @@ numeric characters.
 So the non-String type support for JestId annotation is purely for ease of use and should
 not be used if you plan to use the automatic id generation functionality of Elasticsearch.
 
-#### Version field support (aka Optimistic Concurrency Control)
-
-`_version` field for documents are supported via the @JestVersion annotation. Marking a 
-property of your bean with @JestVersion will cause that field to be serialized and deserialized
-as `_version` in the document JSON communicated to Elasticsearch. This in turn lets you 
-use the [Optimistic Concurrency Control](https://www.elastic.co/guide/en/elasticsearch/guide/current/optimistic-concurrency-control.html#optimistic-concurrency-control) capabilities provided by Elasticsearch.
-
-```java
-class Article {
-
-@JestId
-private String documentId;
-
-@JestVersion
-private Long documentVersion;
-
-}
-```
-
 ### Searching Documents
 
 Search queries can be either JSON String or created by ElasticSearch SourceBuilder
@@ -474,18 +455,6 @@ ClientConfig clientConfig = new ClientConfig.Builder("http://localhost:9200")
     .build();
 ```
 
-Setting a filter on the nodes to discover will allow you specify they types of nodes to discover, 
-with the same syntax as outlined in [Node Specification](https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster.html#cluster-nodes) for Elasticsearch.
-For example: 
-```java
-//enable host discovery
-ClientConfig clientConfig = new ClientConfig.Builder("http://localhost:9200")
-    .discoveryEnabled(true)
-    .discoveryFrequency(1l, TimeUnit.MINUTES)
-    .discoveryFilter("type:arbitrary")
-    .build();
-```
-
 ### Authentication
 
 Basic username and password authentication can be configured when constructing the client; it should be noted that
diff --git a/jest/pom.xml b/jest/pom.xml
index 85059e3a..5d51f816 100644
--- a/jest/pom.xml
+++ b/jest/pom.xml
@@ -45,7 +45,7 @@
     <parent>
         <groupId>io.searchbox</groupId>
         <artifactId>jest-parent</artifactId>
-        <version>2.0.4-SNAPSHOT</version>
+        <version>2.0.3-SNAPSHOT</version>
     </parent>
 
     <dependencies>
diff --git a/jest/src/main/java/io/searchbox/client/JestClientFactory.java b/jest/src/main/java/io/searchbox/client/JestClientFactory.java
index 1f3c32bd..9e00c44f 100755
--- a/jest/src/main/java/io/searchbox/client/JestClientFactory.java
+++ b/jest/src/main/java/io/searchbox/client/JestClientFactory.java
@@ -6,20 +6,13 @@ import io.searchbox.client.config.discovery.NodeChecker;
 import io.searchbox.client.config.idle.HttpReapableConnectionManager;
 import io.searchbox.client.config.idle.IdleConnectionReaper;
 import io.searchbox.client.http.JestHttpClient;
-
-import org.apache.commons.lang3.StringUtils;
-import org.apache.http.HttpHost;
-import org.apache.http.client.AuthCache;
 import org.apache.http.client.config.RequestConfig;
-import org.apache.http.client.protocol.HttpClientContext;
 import org.apache.http.config.Registry;
 import org.apache.http.config.RegistryBuilder;
 import org.apache.http.conn.HttpClientConnectionManager;
 import org.apache.http.conn.routing.HttpRoute;
 import org.apache.http.conn.routing.HttpRoutePlanner;
 import org.apache.http.conn.socket.ConnectionSocketFactory;
-import org.apache.http.impl.auth.BasicScheme;
-import org.apache.http.impl.client.BasicAuthCache;
 import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.impl.client.HttpClientBuilder;
 import org.apache.http.impl.client.HttpClients;
@@ -74,9 +67,6 @@ public class JestClientFactory {
         // set discovery (should be set after setting the httpClient on jestClient)
         if (httpClientConfig.isDiscoveryEnabled()) {
             log.info("Node Discovery enabled...");
-            if (StringUtils.isNotEmpty(httpClientConfig.getDiscoveryFilter())) {
-                log.info("Node Discovery filtering nodes on \"{}\"", httpClientConfig.getDiscoveryFilter());
-            }
             NodeChecker nodeChecker = createNodeChecker(client, httpClientConfig);
             client.setNodeChecker(nodeChecker);
             nodeChecker.startAsync();
@@ -97,12 +87,6 @@ public class JestClientFactory {
             log.info("Idle connection reaping disabled...");
         }
 
-        HttpHost preemptiveAuthTargetHost = httpClientConfig.getPreemptiveAuthTargetHost();
-        if (preemptiveAuthTargetHost != null) {
-            log.info("Authentication cache set for preemptive authentication");
-            client.setHttpClientContextTemplate(createPreemptiveAuthContext(preemptiveAuthTargetHost));
-        }
-
         return client;
     }
 
@@ -248,21 +232,4 @@ public class JestClientFactory {
         return new NodeChecker(client, httpClientConfig);
     }
 
-    // Extension point
-    protected HttpClientContext createPreemptiveAuthContext(HttpHost targetHost) {
-        HttpClientContext context = HttpClientContext.create();
-        context.setCredentialsProvider(httpClientConfig.getCredentialsProvider());
-        context.setAuthCache(createBasicAuthCache(targetHost));
-
-        return context;
-    }
-
-    private AuthCache createBasicAuthCache(HttpHost targetHost) {
-        AuthCache authCache = new BasicAuthCache();
-        BasicScheme basicAuth = new BasicScheme();
-        authCache.put(targetHost, basicAuth);
-
-        return authCache;
-    }
-
 }
diff --git a/jest/src/main/java/io/searchbox/client/config/HttpClientConfig.java b/jest/src/main/java/io/searchbox/client/config/HttpClientConfig.java
index ae6e30ef..545cd9ab 100644
--- a/jest/src/main/java/io/searchbox/client/config/HttpClientConfig.java
+++ b/jest/src/main/java/io/searchbox/client/config/HttpClientConfig.java
@@ -39,7 +39,6 @@ public class HttpClientConfig extends ClientConfig {
     private final AuthenticationStrategy proxyAuthenticationStrategy;
     private final SchemeIOSessionStrategy httpIOSessionStrategy;
     private final SchemeIOSessionStrategy httpsIOSessionStrategy;
-    private HttpHost preemptiveAuthTargetHost;
 
     public HttpClientConfig(Builder builder) {
         super(builder);
@@ -53,7 +52,6 @@ public class HttpClientConfig extends ClientConfig {
         this.proxyAuthenticationStrategy = builder.proxyAuthenticationStrategy;
         this.httpIOSessionStrategy = builder.httpIOSessionStrategy;
         this.httpsIOSessionStrategy = builder.httpsIOSessionStrategy;
-        this.preemptiveAuthTargetHost = builder.preemptiveAuthTargetHost;
     }
 
     public Map<HttpRoute, Integer> getMaxTotalConnectionPerRoute() {
@@ -96,10 +94,6 @@ public class HttpClientConfig extends ClientConfig {
         return httpsIOSessionStrategy;
     }
 
-    public HttpHost getPreemptiveAuthTargetHost() {
-        return preemptiveAuthTargetHost;
-    }
-
     public static class Builder extends ClientConfig.AbstractBuilder<HttpClientConfig, Builder> {
 
         private Integer maxTotalConnection;
@@ -112,7 +106,6 @@ public class HttpClientConfig extends ClientConfig {
         private AuthenticationStrategy proxyAuthenticationStrategy;
         private SchemeIOSessionStrategy httpIOSessionStrategy;
         private SchemeIOSessionStrategy httpsIOSessionStrategy;
-        private HttpHost preemptiveAuthTargetHost;
 
         public Builder(HttpClientConfig httpClientConfig) {
             super(httpClientConfig);
@@ -238,19 +231,6 @@ public class HttpClientConfig extends ClientConfig {
             return this;
         }
 
-        /**
-         * Sets preemptive authentication for the specified <b>target host</b> by pre-populating an authentication data cache
-         * <p>
-         * It is mandatory to set a credential provider to use preemptive authentication
-         * </p><p>
-         * If preemptive authentication is set without setting a credentials provider an exception will be thrown
-         * </p>
-         */
-        public Builder setPreemptiveAuth(HttpHost targetHost) {
-            this.preemptiveAuthTargetHost = targetHost;
-            return this;
-        }
-
         public Builder proxy(HttpHost proxy) {
             return proxy(proxy, null);
         }
@@ -278,18 +258,9 @@ public class HttpClientConfig extends ClientConfig {
             if(this.httpsIOSessionStrategy == null) {
                 this.httpsIOSessionStrategy = SSLIOSessionStrategy.getSystemDefaultStrategy();
             }
-
-            if (preemptiveAuthSetWithoutCredentials()) {
-                throw new IllegalArgumentException("Preemptive authentication set without credentials provider");
-            }
-
             return new HttpClientConfig(this);
         }
 
-        private boolean preemptiveAuthSetWithoutCredentials() {
-            return preemptiveAuthTargetHost != null && credentialsProvider == null;
-        }
-
     }
 
 }
diff --git a/jest/src/main/java/io/searchbox/client/http/JestHttpClient.java b/jest/src/main/java/io/searchbox/client/http/JestHttpClient.java
index 395d4888..df365447 100755
--- a/jest/src/main/java/io/searchbox/client/http/JestHttpClient.java
+++ b/jest/src/main/java/io/searchbox/client/http/JestHttpClient.java
@@ -4,23 +4,18 @@ import io.searchbox.action.Action;
 import io.searchbox.client.AbstractJestClient;
 import io.searchbox.client.JestResult;
 import io.searchbox.client.JestResultHandler;
-import io.searchbox.client.config.exception.CouldNotConnectException;
 import io.searchbox.client.http.apache.HttpDeleteWithEntity;
 import io.searchbox.client.http.apache.HttpGetWithEntity;
 import java.io.IOException;
 import java.util.Map.Entry;
-import java.util.concurrent.Future;
 
 import org.apache.http.*;
 import org.apache.http.client.entity.EntityBuilder;
-import org.apache.http.client.methods.CloseableHttpResponse;
 import org.apache.http.client.methods.HttpHead;
 import org.apache.http.client.methods.HttpPost;
 import org.apache.http.client.methods.HttpPut;
 import org.apache.http.client.methods.HttpUriRequest;
-import org.apache.http.client.protocol.HttpClientContext;
 import org.apache.http.concurrent.FutureCallback;
-import org.apache.http.conn.HttpHostConnectException;
 import org.apache.http.entity.ContentType;
 import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.impl.nio.client.CloseableHttpAsyncClient;
@@ -42,22 +37,16 @@ public class JestHttpClient extends AbstractJestClient {
     private CloseableHttpClient httpClient;
     private CloseableHttpAsyncClient asyncClient;
 
-    private HttpClientContext httpClientContextTemplate;
-
     /**
      * @throws IOException in case of a problem or the connection was aborted during request,
      *                     or in case of a problem while reading the response stream
-     * @throws CouldNotConnectException if an {@link HttpHostConnectException} is encountered
      */
     @Override
     public <T extends JestResult> T execute(Action<T> clientRequest) throws IOException {
         HttpUriRequest request = prepareRequest(clientRequest);
-        try {
-            HttpResponse response = executeRequest(request);
-            return deserializeResponse(response, request, clientRequest);
-        } catch (HttpHostConnectException ex) {
-            throw new CouldNotConnectException(ex.getHost().toURI(), ex);
-        }
+        HttpResponse response = httpClient.execute(request);
+
+        return deserializeResponse(response, request, clientRequest);
     }
 
     @Override
@@ -69,7 +58,7 @@ public class JestHttpClient extends AbstractJestClient {
         }
 
         HttpUriRequest request = prepareRequest(clientRequest);
-        executeAsyncRequest(clientRequest, resultHandler, request);
+        asyncClient.execute(request, new DefaultCallback<T>(clientRequest, request, resultHandler));
     }
 
     @Override
@@ -101,30 +90,6 @@ public class JestHttpClient extends AbstractJestClient {
         return request;
     }
 
-    protected CloseableHttpResponse executeRequest(HttpUriRequest request) throws IOException {
-        if (httpClientContextTemplate != null) {
-            return httpClient.execute(request, createContextInstance());
-        }
-
-        return httpClient.execute(request);
-    }
-
-    protected <T extends JestResult> Future<HttpResponse> executeAsyncRequest(Action<T> clientRequest, JestResultHandler<? super T> resultHandler, HttpUriRequest request) {
-        if (httpClientContextTemplate != null) {
-            return asyncClient.execute(request, createContextInstance(), new DefaultCallback<T>(clientRequest, request, resultHandler));
-        }
-
-        return asyncClient.execute(request, new DefaultCallback<T>(clientRequest, request, resultHandler));
-    }
-
-    protected HttpClientContext createContextInstance() {
-        HttpClientContext context = HttpClientContext.create();
-        context.setCredentialsProvider(httpClientContextTemplate.getCredentialsProvider());
-        context.setAuthCache(httpClientContextTemplate.getAuthCache());
-
-        return context;
-    }
-
     protected HttpUriRequest constructHttpMethod(String methodName, String url, String payload) {
         HttpUriRequest httpUriRequest = null;
 
@@ -207,14 +172,6 @@ public class JestHttpClient extends AbstractJestClient {
         this.gson = gson;
     }
 
-    public HttpClientContext getHttpClientContextTemplate() {
-        return httpClientContextTemplate;
-    }
-
-    public void setHttpClientContextTemplate(HttpClientContext httpClientContext) {
-        this.httpClientContextTemplate = httpClientContext;
-    }
-
     protected class DefaultCallback<T extends JestResult> implements FutureCallback<HttpResponse> {
         private final Action<T> clientRequest;
         private final HttpRequest request;
@@ -240,11 +197,6 @@ public class JestHttpClient extends AbstractJestClient {
         @Override
         public void failed(final Exception ex) {
             log.error("Exception occurred during async execution.", ex);
-            if (ex instanceof HttpHostConnectException) {
-                String host = ((HttpHostConnectException) ex).getHost().toURI();
-                resultHandler.failed(new CouldNotConnectException(host, ex));
-                return;
-            }
             resultHandler.failed(ex);
         }
 
diff --git a/pom.xml b/pom.xml
index feb0d0c0..846b577c 100755
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
     <groupId>io.searchbox</groupId>
     <artifactId>jest-parent</artifactId>
     <packaging>pom</packaging>
-    <version>2.0.4-SNAPSHOT</version>
+    <version>2.0.3-SNAPSHOT</version>
     <name>Jest Parent POM</name>
     <description>Parent POM for Jest - ElasticSearch Java rest client</description>
     <url>https://github.com/searchbox-io/Jest</url>
@@ -73,14 +73,14 @@
         <httpAsyncClient.version>4.1.1</httpAsyncClient.version>
         <httpclientandroid.version>4.3.5.1</httpclientandroid.version>
 
-        <slf4j.version>1.7.21</slf4j.version>
+        <slf4j.version>1.7.13</slf4j.version>
 
         <guava.version>19.0</guava.version>
         <gson.version>2.6.2</gson.version>
         <mockito.version>1.10.19</mockito.version>
 
         <commonsLang.version>3.4</commonsLang.version>
-        <commons-io.version>2.5</commons-io.version>
+        <commons-io.version>2.4</commons-io.version>
         <junit.version>4.12</junit.version>
 
         <plugin.surefire.version>2.19.1</plugin.surefire.version>
@@ -256,7 +256,7 @@
             <dependency>
                 <groupId>io.searchbox</groupId>
                 <artifactId>jest-common</artifactId>
-                <version>2.0.4-SNAPSHOT</version>
+                <version>2.0.3-SNAPSHOT</version>
             </dependency>
 
             <!-- Testing Dependencies -->


Test patch:
diff --git a/jest-common/src/test/java/io/searchbox/client/JestResultTest.java b/jest-common/src/test/java/io/searchbox/client/JestResultTest.java
index b951d764..4ddf2c7b 100644
--- a/jest-common/src/test/java/io/searchbox/client/JestResultTest.java
+++ b/jest-common/src/test/java/io/searchbox/client/JestResultTest.java
@@ -375,7 +375,6 @@ public class JestResultTest {
                 "                \"_index\" : \"twitter\",\n" +
                 "                \"_type\" : \"tweet\",\n" +
                 "                \"_id\" : \"1\", \n" +
-                "                \"_version\" : \"2\", \n" +
                 "                \"_source\" : {\n" +
                 "                    \"user\" : \"kimchy\",\n" +
                 "                    \"postDate\" : \"2009-11-15T14:12:12\",\n" +
@@ -392,7 +391,7 @@ public class JestResultTest {
         expectedResultMap.put("postDate", "2009-11-15T14:12:12");
         expectedResultMap.put("message", "trying out Elastic Search");
         JsonObject actualResultMap = result.extractSource().get(0).getAsJsonObject();
-        assertEquals(expectedResultMap.size() + 2, actualResultMap.entrySet().size());
+        assertEquals(expectedResultMap.size() + 1, actualResultMap.entrySet().size());
         for (String key : expectedResultMap.keySet()) {
             assertEquals(expectedResultMap.get(key).toString(), actualResultMap.get(key).getAsString());
         }
diff --git a/jest-common/src/test/java/io/searchbox/client/config/discovery/NodeCheckerTest.java b/jest-common/src/test/java/io/searchbox/client/config/discovery/NodeCheckerTest.java
index 695b1846..4cb43b3a 100644
--- a/jest-common/src/test/java/io/searchbox/client/config/discovery/NodeCheckerTest.java
+++ b/jest-common/src/test/java/io/searchbox/client/config/discovery/NodeCheckerTest.java
@@ -1,29 +1,23 @@
 package io.searchbox.client.config.discovery;
 
 import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableSet;
 import com.google.gson.Gson;
 import io.searchbox.action.Action;
 import io.searchbox.client.JestClient;
 import io.searchbox.client.JestResult;
 import io.searchbox.client.config.ClientConfig;
-import io.searchbox.client.config.exception.CouldNotConnectException;
 import org.junit.Before;
 import org.junit.Test;
 import org.mockito.ArgumentCaptor;
 
-import java.io.IOException;
-import java.util.Iterator;
 import java.util.LinkedHashSet;
 import java.util.Set;
 import java.util.concurrent.TimeUnit;
 
 import static org.junit.Assert.assertEquals;
 import static org.mockito.Matchers.isA;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.verifyNoMoreInteractions;
-import static org.mockito.Mockito.when;
+import static org.mockito.Mockito.*;
 
 public class NodeCheckerTest {
 
@@ -247,77 +241,4 @@ public class NodeCheckerTest {
         assertEquals("http://localhost:9200", servers.iterator().next());
     }
 
-
-    @Test
-    public void testNodesInfoExceptionRemovesServerFromList() throws Exception {
-        NodeChecker nodeChecker = new NodeChecker(jestClient, clientConfig);
-
-        JestResult result = new JestResult(new Gson());
-        result.setJsonMap(ImmutableMap.<String, Object>of(
-                "ok", "true",
-                "nodes", ImmutableMap.of(
-                        "node1", ImmutableMap.of(
-                                "http_address", "inet[/192.168.2.7:9200]"),
-                        "node2", ImmutableMap.of(
-                                "http_address", "inet[/192.168.2.8:9200]"),
-                        "node3", ImmutableMap.of(
-                                "http_address", "inet[/192.168.2.9:9200]"))));
-        result.setSucceeded(true);
-        when(jestClient.execute(isA(Action.class))).thenReturn(result);
-        nodeChecker.runOneIteration();
-
-        verify(jestClient).execute(isA(Action.class));
-        ArgumentCaptor<LinkedHashSet> argument = ArgumentCaptor.forClass(LinkedHashSet.class);
-        verify(jestClient).setServers(argument.capture());
-        verify(jestClient).execute(isA(Action.class));
-
-        Set servers = argument.getValue();
-        assertEquals(3, servers.size());
-
-//      	when(jestClient.execute(isA(Action.class))).thenThrow(new HttpHostConnectException(
-//            new ConnectException(), new HttpHost("192.168.2.7", 9200, "http"), null));
-        when(jestClient.execute(isA(Action.class))).thenThrow(new CouldNotConnectException("http://192.168.2.7:9200", new IOException("Test HttpHostException")));
-        nodeChecker.runOneIteration();
-
-        verify(jestClient, times(2)).execute(isA(Action.class));
-        verify(jestClient, times(2)).setServers(argument.capture());
-        verifyNoMoreInteractions(jestClient);
-
-        servers = argument.getValue();
-        assertEquals(2, servers.size());
-        Iterator serversItr = servers.iterator();
-        assertEquals("http://192.168.2.8:9200", serversItr.next());
-        assertEquals("http://192.168.2.9:9200", serversItr.next());
-
-        // fail at the 2nd node
-        //      when(jestClient.execute(isA(Action.class))).thenThrow(new HttpHostConnectException(
-        //            new ConnectException(), new HttpHost("192.168.2.8", 9200, "http"), null));
-        when(jestClient.execute(isA(Action.class))).thenThrow(new CouldNotConnectException("http://192.168.2.8:9200", new IOException("Test HttpHostException")));
-        nodeChecker.runOneIteration();
-
-        verify(jestClient, times(3)).execute(isA(Action.class));
-        verify(jestClient, times(3)).setServers(argument.capture());
-        verifyNoMoreInteractions(jestClient);
-
-        servers = argument.getValue();
-        assertEquals(1, servers.size());
-        serversItr = servers.iterator();
-        assertEquals("http://192.168.2.9:9200", serversItr.next());
-
-        // fail at the last node, fail back to bootstrap
-//      	when(jestClient.execute(isA(Action.class))).thenThrow(new HttpHostConnectException(
-//            new ConnectException(), new HttpHost("192.168.2.9", 9200, "http"), null));
-        when(jestClient.execute(isA(Action.class))).thenThrow(new CouldNotConnectException("http://192.168.2.9:9200", new IOException("Test HttpHostException")));
-        nodeChecker.runOneIteration();
-
-        verify(jestClient, times(4)).execute(isA(Action.class));
-        verify(jestClient, times(4)).setServers(argument.capture());
-        verifyNoMoreInteractions(jestClient);
-
-        servers = argument.getValue();
-        assertEquals(1, servers.size());
-        serversItr = servers.iterator();
-        assertEquals("http://localhost:9200", serversItr.next());
-    }
-
 }
diff --git a/jest-common/src/test/java/io/searchbox/core/BulkResultTest.java b/jest-common/src/test/java/io/searchbox/core/BulkResultTest.java
deleted file mode 100644
index 86645dcf..00000000
--- a/jest-common/src/test/java/io/searchbox/core/BulkResultTest.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package io.searchbox.core;
-
-
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-import org.junit.Test;
-
-import java.util.Map;
-
-import static org.junit.Assert.assertEquals;
-
-public class BulkResultTest {
-
-    static String indexFailedResult = "{\n" +
-            "    \"took\": 10,\n" +
-            "    \"errors\": true,\n" +
-            "    \"items\": [\n" +
-            "        {\n" +
-            "            \"index\": {\n" +
-            "                \"_index\": \"index-name\",\n" +
-            "                \"_type\": \"type-name\",\n" +
-            "                \"_id\": null,\n" +
-            "                \"status\": 400,\n" +
-            "                \"error\": \"MapperParsingException[mapping [type-name]]; nested: MapperParsingException[No type specified for property [field-name]]; \"\n" +
-            "            }\n" +
-            "        }\n" +
-            "    ]\n" +
-            "}";
-
-    @Test
-    public void bulkResultWithFailures() {
-        BulkResult bulkResult = new BulkResult(new GsonBuilder().serializeNulls().create());
-        bulkResult.setJsonString(indexFailedResult);
-        bulkResult.setJsonMap(new Gson().fromJson(indexFailedResult, Map.class));
-        bulkResult.setSucceeded(false);
-
-        assertEquals(1, bulkResult.getItems().size());
-        assertEquals(1, bulkResult.getFailedItems().size());
-    }
-}
diff --git a/jest-common/src/test/java/io/searchbox/core/DocTest.java b/jest-common/src/test/java/io/searchbox/core/DocTest.java
index fcf0c1dd..9789677f 100644
--- a/jest-common/src/test/java/io/searchbox/core/DocTest.java
+++ b/jest-common/src/test/java/io/searchbox/core/DocTest.java
@@ -53,10 +53,19 @@ public class DocTest {
         fail("Constructor should have thrown an exception when index was null");
     }
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test
     public void testConstructionWithNullType() {
-        new Doc("idx", null, "id");
-        fail("Constructor should have thrown an exception when type was null");
+        String index = "idx0";
+        String id = "00001_AE";
+        Map<String, Object> expectedMap = new HashMap<String, Object>();
+        expectedMap.put("_index", index);
+        expectedMap.put("_id", id);
+
+        Doc doc = new Doc(index, id);
+        Map<String, Object> actualMap = doc.toMap();
+
+        assertEquals(2, actualMap.size());
+        assertEquals(expectedMap, actualMap);
     }
 
     @Test(expected = IllegalArgumentException.class)
diff --git a/jest-common/src/test/java/io/searchbox/core/DocumentResultTest.java b/jest-common/src/test/java/io/searchbox/core/DocumentResultTest.java
index 680ebf77..37c21c0f 100644
--- a/jest-common/src/test/java/io/searchbox/core/DocumentResultTest.java
+++ b/jest-common/src/test/java/io/searchbox/core/DocumentResultTest.java
@@ -49,11 +49,6 @@ public class DocumentResultTest {
         assertEquals("testId", validResult.getId());
     }
 
-    @Test
-    public void shouldFetchVersionFromValidResponse() {
-        assertEquals(Long.valueOf(2), validResult.getVersion());
-    }
-
     @Test
     public void shouldReturnNullIndexOnInvalidResponse() {
         assertNull(invalidResult.getIndex());
diff --git a/jest-common/src/test/java/io/searchbox/core/SearchResultTest.java b/jest-common/src/test/java/io/searchbox/core/SearchResultTest.java
index f4016879..1606f6b4 100644
--- a/jest-common/src/test/java/io/searchbox/core/SearchResultTest.java
+++ b/jest-common/src/test/java/io/searchbox/core/SearchResultTest.java
@@ -2,8 +2,6 @@ package io.searchbox.core;
 
 import com.google.gson.Gson;
 import com.google.gson.JsonParser;
-import io.searchbox.annotations.JestId;
-import io.searchbox.annotations.JestVersion;
 import org.junit.Test;
 
 import java.util.List;
@@ -251,68 +249,4 @@ public class SearchResultTest {
         assertNotNull(hit.score);
     }
 
-    @Test
-    public void testGetVersion() {
-        Long someVersion = Integer.MAX_VALUE + 10L;
-
-        String jsonWithVersion = "{\n" +
-                "    \"_shards\":{\n" +
-                "        \"total\" : 5,\n" +
-                "        \"successful\" : 5,\n" +
-                "        \"failed\" : 0\n" +
-                "    },\n" +
-                "    \"hits\":{\n" +
-                "        \"total\" : 1,\n" +
-                "        \"hits\" : [\n" +
-                "            {\n" +
-                "                \"_index\" : \"twitter\",\n" +
-                "                \"_type\" : \"tweet\",\n" +
-                "                \"_score\" : \"1.02332\",\n" +
-                "                \"_id\" : \"1\",\n" +
-                "                \"_version\" : \"" + someVersion + "\",\n" +
-                "                \"_source\" : {\n" +
-                "                    \"user\" : \"kimchy\",\n" +
-                "                    \"postDate\" : \"2009-11-15T14:12:12\",\n" +
-                "                    \"message\" : \"trying out Elasticsearch\"\n" +
-                "                },\n" +
-                "                \"sort\" : [\n" +
-                "                     1234.5678\n" +
-                "                ]\n" +
-                "            }\n" +
-                "        ]\n" +
-                "    }\n" +
-                "}";
-
-        SearchResult searchResult = new SearchResult(new Gson());
-        searchResult.setSucceeded(true);
-        searchResult.setJsonString(jsonWithVersion);
-        searchResult.setJsonObject(new JsonParser().parse(jsonWithVersion).getAsJsonObject());
-        searchResult.setPathToResult("hits/hits/_source");
-
-        SearchResult.Hit<TestObject, Void> hit = searchResult.getFirstHit(TestObject.class);
-        assertNotNull(hit.source);
-        assertNull(hit.explanation);
-        assertNotNull(hit.sort);
-        assertNotNull(hit.score);
-        assertEquals("Incorrect version", someVersion, hit.source.getVersion());
-    }
-
-    class TestObject {
-        @JestId
-        private String id;
-
-        @JestVersion
-        private Long version;
-
-        public TestObject() {}
-
-        public Long getVersion() {
-            return version;
-        }
-
-        public String getId() {
-            return id;
-        }
-    }
-
 }
diff --git a/jest-common/src/test/java/io/searchbox/core/SearchTest.java b/jest-common/src/test/java/io/searchbox/core/SearchTest.java
index ea80cd5b..3f8d4626 100644
--- a/jest-common/src/test/java/io/searchbox/core/SearchTest.java
+++ b/jest-common/src/test/java/io/searchbox/core/SearchTest.java
@@ -80,12 +80,6 @@ public class SearchTest {
         assertEquals("twitter/tweet/_search/template", search.getURI());
     }
 
-    @Test
-    public void getURIWithVersion() {
-        Action search = new Search.VersionBuilder("").addIndex("twitter").addType("tweet").build();
-        assertTrue("Version Parameter missing", search.getURI().contains("version=true"));
-    }
-
     @Test
     public void sortTest() {
         String query = "{\"query\" : { \"term\" : { \"name\" : \"Milano\" } }}";
diff --git a/jest-common/src/test/java/io/searchbox/search/aggregation/TopHitsAggregationTest.java b/jest-common/src/test/java/io/searchbox/search/aggregation/TopHitsAggregationTest.java
deleted file mode 100644
index b71163fb..00000000
--- a/jest-common/src/test/java/io/searchbox/search/aggregation/TopHitsAggregationTest.java
+++ /dev/null
@@ -1,124 +0,0 @@
-package io.searchbox.search.aggregation;
-
-import static org.junit.Assert.*;
-
-import java.util.List;
-
-import org.junit.Test;
-
-import com.google.gson.Gson;
-import com.google.gson.JsonParser;
-
-import io.searchbox.core.SearchResult;
-import io.searchbox.core.search.aggregation.TermsAggregation;
-import io.searchbox.core.search.aggregation.TermsAggregation.Entry;
-import io.searchbox.core.search.aggregation.TopHitsAggregation;
-
-public class TopHitsAggregationTest {
-    String json = "{\n" +
-            "    \"_shards\":{\n" +
-            "        \"total\" : 5,\n" +
-            "        \"successful\" : 5,\n" +
-            "        \"failed\" : 0\n" +
-            "    },\n" +
-            "    \"hits\":{\n" +
-            "        \"total\" : 1,\n" +
-            "	     \"hits\": []\n" +
-            "    },\n" +
-            "    \"aggregations\": {\n" +
-            "        \"test\": {\n" +
-            "            \"doc_count_error_upper_bound\": 1,\n" +
-            "            \"sum_other_doc_count\": 2,\n" +
-            "            \"buckets\": [\n" +
-            "                {\n" +
-            "                    \"key\": \"keyTest1\",\n" +
-            "                    \"doc_count\": 2,\n" +
-            "                    \"top_hits_test\": {\n" +
-            "                        \"hits\": {\n" +
-            "                            \"total\": 2,\n" +
-            "                            \"max_score\": 1.22222,\n" +
-            "                            \"hits\": [\n" +
-            "                                {\n" +
-            "                                    \"_index\": \"indexName\",\n" +
-            "                                    \"_type\": \"typeName\",\n" +
-            "                                    \"_id\": \"testId1\",\n" +
-            "                                    \"_score\": 1.11111,\n" +
-            "                                    \"_source\": {\n" +
-            "                                        \"field1\": \"field1Content\"\n" +
-            "                                    }\n" +
-            "                                },\n" +
-            "                                {\n" +
-            "                                    \"_index\": \"indexName\",\n" +
-            "                                    \"_type\": \"typeName\",\n" +
-            "                                    \"_id\": \"testId2\",\n" +
-            "                                    \"_score\": 1.0000,\n" +
-            "                                    \"_source\": {\n" +
-            "                                        \"field1\": \"field2Content\"\n" +
-            "                                    }\n" +
-            "                                }\n" +
-            "                            ]\n" +
-            "                        }\n" +
-            "                    }\n" +
-            "                },\n" +
-            "                {\n" +
-            "                    \"key\": \"keyTest2\",\n" +
-            "                    \"doc_count\": 2,\n" +
-            "                    \"top_hits_test\": {\n" +
-            "                        \"hits\": {\n" +
-            "                            \"total\": 2,\n" +
-            "                            \"max_score\": 1.22222,\n" +
-            "                            \"hits\": [\n" +
-            "                                {\n" +
-            "                                    \"_index\": \"indexName\",\n" +
-            "                                    \"_type\": \"typeName\",\n" +
-            "                                    \"_id\": \"testId21\",\n" +
-            "                                    \"_score\": 1.11111,\n" +
-            "                                    \"_source\": {\n" +
-            "                                        \"field1\": \"field21Content\"\n" +
-            "                                    }\n" +
-            "                                },\n" +
-            "                                {\n" +
-            "                                    \"_index\": \"indexName\",\n" +
-            "                                    \"_type\": \"typeName\",\n" +
-            "                                    \"_id\": \"testId22\",\n" +
-            "                                    \"_score\": 1.0000,\n" +
-            "                                    \"_source\": {\n" +
-            "                                        \"field1\": \"field22Content\"\n" +
-            "                                    }\n" +
-            "                                }\n" +
-            "                            ]\n" +
-            "                        }\n" +
-            "                    }\n" +
-            "                }\n" +
-            "            ]\n" +
-            "        }\n" +
-            "    }\n" + 
-            "}";
-
-    @Test
-    public void testGetMaxScoreWhenMissing() {	
-        SearchResult searchResult = new SearchResult(new Gson());
-        searchResult.setSucceeded(true);
-        searchResult.setJsonString(json);
-        searchResult.setJsonObject(new JsonParser().parse(json).getAsJsonObject());
-        searchResult.setPathToResult("hits/hits/_source");
-
-        Float maxScore = searchResult.getMaxScore();
-        assertNull(maxScore);
-        
-        TermsAggregation termsAgg = searchResult.getAggregations().getTermsAggregation("test");
-
-	assertEquals(new Long(1), termsAgg.getDocCountErrorUpperBound());
-	assertEquals(new Long(2), termsAgg.getSumOtherDocCount());
-
-	List<Entry> termBuckets = termsAgg.getBuckets();
-
-	for (Entry entry : termBuckets) {
-	    TopHitsAggregation topHitAgg = entry.getTopHitsAggregation("top_hits_test");
-
-	    List<String> hits = topHitAgg.getSourceAsStringList();
-
-	    assertEquals(2, hits.size());
-	}
-    }
-}
diff --git a/jest-common/src/test/java/io/searchbox/snapshot/CreateSnapshotRepositoryTest.java b/jest-common/src/test/java/io/searchbox/snapshot/CreateSnapshotRepositoryTest.java
deleted file mode 100644
index 9683352f..00000000
--- a/jest-common/src/test/java/io/searchbox/snapshot/CreateSnapshotRepositoryTest.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package io.searchbox.snapshot;
-
-import com.google.gson.Gson;
-import org.elasticsearch.common.settings.Settings;
-import org.junit.Test;
-
-import static junit.framework.Assert.assertEquals;
-
-/**
- * @author happyprg(hongsgo@gmail.com)
- */
-public class CreateSnapshotRepositoryTest {
-
-    private String repository = "seohoo";
-
-    @Test
-    public void testBasicUriGeneration() {
-        final Settings.Builder registerRepositorySettings = Settings.settingsBuilder();
-        registerRepositorySettings.put("type", "fs");
-        registerRepositorySettings.put("settings.compress", "true");
-        registerRepositorySettings.put("settings.location", "/mount/backups/my_backup");
-        registerRepositorySettings.put("settings.chunk_size", "10m");
-        registerRepositorySettings.put("settings.max_restore_bytes_per_sec", "40mb");
-        registerRepositorySettings.put("settings.max_snapshot_bytes_per_sec", "40mb");
-        registerRepositorySettings.put("settings.readonly", "false");
-
-        CreateSnapshotRepository createSnapshotRepository = new CreateSnapshotRepository.Builder(repository).settings(registerRepositorySettings.build().getAsMap()).build();
-
-        assertEquals("PUT", createSnapshotRepository.getRestMethodName());
-        assertEquals("/_snapshot/" + repository, createSnapshotRepository.getURI());
-        String settings = new Gson().toJson(createSnapshotRepository.getData(new Gson()));
-        assertEquals("\"{\\\"settings.chunk_size\\\":\\\"10m\\\",\\\"settings.compress\\\":\\\"true\\\",\\\"settings.location\\\":\\\"/mount/backups/my_backup\\\",\\\"settings.max_restore_bytes_per_sec\\\":\\\"40mb\\\",\\\"settings.max_snapshot_bytes_per_sec\\\":\\\"40mb\\\",\\\"settings.readonly\\\":\\\"false\\\",\\\"type\\\":\\\"fs\\\"}\"", settings);
-    }
-
-    @Test
-    public void testVerifyParam() {
-        CreateSnapshotRepository createSnapshotRepository = new CreateSnapshotRepository.Builder(repository).verify(false).build();
-        assertEquals("/_snapshot/seohoo?verify=false", createSnapshotRepository.getURI());
-    }
-}
diff --git a/jest-common/src/test/java/io/searchbox/snapshot/CreateSnapshotTest.java b/jest-common/src/test/java/io/searchbox/snapshot/CreateSnapshotTest.java
deleted file mode 100644
index 31a89b0d..00000000
--- a/jest-common/src/test/java/io/searchbox/snapshot/CreateSnapshotTest.java
+++ /dev/null
@@ -1,42 +0,0 @@
-package io.searchbox.snapshot;
-
-import com.google.gson.Gson;
-import org.elasticsearch.common.settings.Settings;
-import org.junit.Test;
-
-import static junit.framework.Assert.assertEquals;
-
-/**
- * @author happyprg(hongsgo@gmail.com)
- */
-public class CreateSnapshotTest {
-
-    private String repository = "leeseohoo";
-    private String snapshot = "leeseola";
-
-    @Test
-    public void testSnapshot() {
-        CreateSnapshot createSnapshot = new CreateSnapshot.Builder(repository, snapshot).waitForCompletion(true).build();
-        assertEquals("PUT", createSnapshot.getRestMethodName());
-        assertEquals("/_snapshot/leeseohoo/leeseola?wait_for_completion=true", createSnapshot.getURI());
-    }
-
-    @Test
-    public void testSnapshotWithSettings() {
-
-        final Settings.Builder registerRepositorySettings = Settings.settingsBuilder();
-        registerRepositorySettings.put("indices", "index_1,index_2");
-        registerRepositorySettings.put("ignore_unavailable", "true");
-        registerRepositorySettings.put("include_global_state", "false");
-
-        CreateSnapshot createSnapshot = new CreateSnapshot.Builder(repository, snapshot)
-                .settings(registerRepositorySettings.build().getAsMap())
-                .waitForCompletion(true)
-                .build();
-
-        assertEquals("PUT", createSnapshot.getRestMethodName());
-        assertEquals("/_snapshot/leeseohoo/leeseola?wait_for_completion=true", createSnapshot.getURI());
-        String settings = new Gson().toJson(createSnapshot.getData(new Gson()));
-        assertEquals("\"{\\\"ignore_unavailable\\\":\\\"true\\\",\\\"include_global_state\\\":\\\"false\\\",\\\"indices\\\":\\\"index_1,index_2\\\"}\"", settings);
-    }
-}
diff --git a/jest-common/src/test/java/io/searchbox/snapshot/DeleteSnapshotRepositoryTest.java b/jest-common/src/test/java/io/searchbox/snapshot/DeleteSnapshotRepositoryTest.java
deleted file mode 100644
index ebef34b2..00000000
--- a/jest-common/src/test/java/io/searchbox/snapshot/DeleteSnapshotRepositoryTest.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package io.searchbox.snapshot;
-
-import org.junit.Test;
-
-import static junit.framework.Assert.assertEquals;
-
-/**
- * @author happyprg(hongsgo@gmail.com)
- */
-public class DeleteSnapshotRepositoryTest {
-    @Test
-    public void testRepository() {
-        String repository = "leeseohoo";
-
-        DeleteSnapshotRepository deleteSnapshotRepository = new DeleteSnapshotRepository.Builder(repository).build();
-        assertEquals("DELETE", deleteSnapshotRepository.getRestMethodName());
-        assertEquals("/_snapshot/leeseohoo", deleteSnapshotRepository.getURI());
-    }
-}
diff --git a/jest-common/src/test/java/io/searchbox/snapshot/DeleteSnapshotTest.java b/jest-common/src/test/java/io/searchbox/snapshot/DeleteSnapshotTest.java
deleted file mode 100644
index 481460b0..00000000
--- a/jest-common/src/test/java/io/searchbox/snapshot/DeleteSnapshotTest.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package io.searchbox.snapshot;
-
-import org.junit.Test;
-
-import static junit.framework.Assert.assertEquals;
-
-/**
- * @author happyprg(hongsgo@gmail.com)
- */
-public class DeleteSnapshotTest {
-
-    private String repository = "leeseohoo";
-    private String snapshot = "leeseola";
-
-    @Test
-    public void testSnapshot() {
-        DeleteSnapshot deleteSnapshot = new DeleteSnapshot.Builder(repository, snapshot).build();
-        assertEquals("DELETE", deleteSnapshot.getRestMethodName());
-        assertEquals("/_snapshot/leeseohoo/leeseola", deleteSnapshot.getURI());
-    }
-}
diff --git a/jest-common/src/test/java/io/searchbox/snapshot/GetSnapshotRepositoryTest.java b/jest-common/src/test/java/io/searchbox/snapshot/GetSnapshotRepositoryTest.java
deleted file mode 100644
index babf52a0..00000000
--- a/jest-common/src/test/java/io/searchbox/snapshot/GetSnapshotRepositoryTest.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package io.searchbox.snapshot;
-
-import org.junit.Test;
-
-import java.util.Arrays;
-
-import static junit.framework.Assert.assertEquals;
-
-/**
- * @author happyprg(hongsgo@gmail.com)
- */
-public class GetSnapshotRepositoryTest {
-
-    private String repository = "leeseohoo";
-    private String repository2 = "kangsungjeon";
-
-    @Test
-    public void testRepositorySingleName() {
-        GetSnapshotRepository getSnapshotRepository = new GetSnapshotRepository.Builder(repository).build();
-        assertEquals("GET", getSnapshotRepository.getRestMethodName());
-        assertEquals("/_snapshot/leeseohoo", getSnapshotRepository.getURI());
-    }
-
-    @Test
-    public void testRepositoryMultipleNames() {
-        GetSnapshotRepository getSnapshotRepository = new GetSnapshotRepository.Builder(repository)
-                .addRepository(Arrays.asList(repository, repository2)).build();
-        assertEquals("/_snapshot/leeseohoo,kangsungjeon", getSnapshotRepository.getURI());
-    }
-
-    @Test
-    public void testRepositoryAll() {
-        GetSnapshotRepository getSnapshotRepository = new GetSnapshotRepository.Builder().build();
-        assertEquals("/_snapshot/_all", getSnapshotRepository.getURI());
-    }
-}
diff --git a/jest-common/src/test/java/io/searchbox/snapshot/GetSnapshotTest.java b/jest-common/src/test/java/io/searchbox/snapshot/GetSnapshotTest.java
deleted file mode 100644
index 34ea56f7..00000000
--- a/jest-common/src/test/java/io/searchbox/snapshot/GetSnapshotTest.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package io.searchbox.snapshot;
-
-import org.junit.Test;
-
-import java.util.Arrays;
-
-import static junit.framework.Assert.assertEquals;
-
-/**
- * @author happyprg(hongsgo@gmail.com)
- */
-public class GetSnapshotTest {
-
-    private String repository = "kangsungjeon";
-    private String snapshot = "leeseohoo";
-    private String snapshot2 = "kangsungjeon";
-
-    @Test
-    public void testSnapshotMultipleNames() {
-        GetSnapshot getSnapshotRepository = new GetSnapshot.Builder(repository).addSnapshot(Arrays.asList(snapshot, snapshot2)).build();
-        assertEquals("/_snapshot/kangsungjeon/leeseohoo,kangsungjeon", getSnapshotRepository.getURI());
-    }
-
-    @Test
-    public void testSnapshotAll() {
-        GetSnapshot getSnapshotRepository = new GetSnapshot.Builder(repository).build();
-        assertEquals("/_snapshot/kangsungjeon/_all", getSnapshotRepository.getURI());
-    }
-
-}
diff --git a/jest-common/src/test/java/io/searchbox/snapshot/RestoreSnapshotTest.java b/jest-common/src/test/java/io/searchbox/snapshot/RestoreSnapshotTest.java
deleted file mode 100644
index 84b865dc..00000000
--- a/jest-common/src/test/java/io/searchbox/snapshot/RestoreSnapshotTest.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package io.searchbox.snapshot;
-
-import com.google.gson.Gson;
-import org.elasticsearch.common.settings.Settings;
-import org.junit.Test;
-
-import static junit.framework.Assert.assertEquals;
-
-/**
- * @author happyprg(hongsgo@gmail.com)
- */
-public class RestoreSnapshotTest {
-
-    private String repository = "leeseohoo";
-    private String snapshot = "leeseola";
-
-    @Test
-    public void testSnapshot() {
-        final Settings.Builder registerRepositorySettings = Settings.settingsBuilder();
-        registerRepositorySettings.put("indices", "index_1,index_2");
-        registerRepositorySettings.put("ignore_unavailable", "true");
-        registerRepositorySettings.put("include_global_state", "false");
-        registerRepositorySettings.put("rename_pattern", "index_(.+)");
-        registerRepositorySettings.put("rename_replacement", "restored_index_$1");
-
-        RestoreSnapshot restoreSnapshot = new RestoreSnapshot.Builder(repository, snapshot)
-                .settings(registerRepositorySettings.build().getAsMap()).build();
-        assertEquals("POST", restoreSnapshot.getRestMethodName());
-        assertEquals("/_snapshot/leeseohoo/leeseola/_restore", restoreSnapshot.getURI());
-        String settings = new Gson().toJson(restoreSnapshot.getData(new Gson()));
-        assertEquals("\"{\\\"ignore_unavailable\\\":\\\"true\\\",\\\"include_global_state\\\":\\\"false\\\",\\\"indices\\\":\\\"index_1,index_2\\\",\\\"rename_pattern\\\":\\\"index_(.+)\\\",\\\"rename_replacement\\\":\\\"restored_index_$1\\\"}\"", settings);
-    }
-}
diff --git a/jest-common/src/test/java/io/searchbox/snapshot/SnapshotStatusTest.java b/jest-common/src/test/java/io/searchbox/snapshot/SnapshotStatusTest.java
deleted file mode 100644
index ea4b7856..00000000
--- a/jest-common/src/test/java/io/searchbox/snapshot/SnapshotStatusTest.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package io.searchbox.snapshot;
-
-import org.junit.Test;
-
-import java.util.Arrays;
-
-import static junit.framework.Assert.assertEquals;
-
-/**
- * @author happyprg(hongsgo@gmail.com)
- */
-public class SnapshotStatusTest {
-
-    private String repository = "leeseohoo";
-    private String snapshot = "leeseola";
-    private String snapshot2 = "kangsungjeon";
-
-    @Test
-    public void testSnapshotSingleName() {
-        SnapshotStatus snapshotStatus = new SnapshotStatus.Builder(repository).addSnapshot(snapshot).build();
-        assertEquals("GET", snapshotStatus.getRestMethodName());
-        assertEquals("/_snapshot/leeseohoo/leeseola/_status", snapshotStatus.getURI());
-    }
-
-    @Test
-    public void testSnapshotMultipleNames() {
-        SnapshotStatus snapshotStatus = new SnapshotStatus.Builder(repository).addSnapshot(Arrays.asList(snapshot, snapshot2)).build();
-        assertEquals("/_snapshot/leeseohoo/leeseola,kangsungjeon/_status", snapshotStatus.getURI());
-    }
-}
diff --git a/jest/src/test/java/io/searchbox/client/JestClientFactoryIntegrationTest.java b/jest/src/test/java/io/searchbox/client/JestClientFactoryIntegrationTest.java
index 0a1f30ac..f03cd4cf 100644
--- a/jest/src/test/java/io/searchbox/client/JestClientFactoryIntegrationTest.java
+++ b/jest/src/test/java/io/searchbox/client/JestClientFactoryIntegrationTest.java
@@ -65,44 +65,6 @@ public class JestClientFactoryIntegrationTest extends ESIntegTestCase {
         jestClient.shutdownClient();
     }
 
-    @Test
-    public void testDiscoveryWithFiltering() throws InterruptedException, IOException {
-        // wait for 3 active nodes
-        internalCluster().ensureAtLeastNumDataNodes(3);
-
-        // spin up two more client nodes with additional attributes
-        Settings settings = Settings.builder().put(internalCluster().getDefaultSettings())
-                .put("node.master", false)      // for example, a client node
-                .put("node.data", false)
-                .put("node.type", "aardvark")  // put some arbitrary attribute to filter by
-                .build();
-        String clientNode1 = internalCluster().startNode(settings);
-        String clientNode2 = internalCluster().startNode(settings);
-        assertNotEquals("client nodes should be different", clientNode1, clientNode2);
-        assertEquals("All nodes in cluster should have HTTP endpoint exposed", 5, cluster().httpAddresses().length);
-
-        factory.setHttpClientConfig(new HttpClientConfig
-                .Builder("http://localhost:" + cluster().httpAddresses()[0].getPort())
-                .discoveryEnabled(true)
-                .discoveryFilter("type:aardvark")
-                .discoveryFrequency(500l, TimeUnit.MILLISECONDS)
-                .build());
-        JestHttpClient jestClient = (JestHttpClient) factory.getObject();
-        assertNotNull(jestClient);
-
-        // wait for NodeChecker to do the discovery
-        Thread.sleep(3000);
-
-        assertEquals(
-                "Only 2 nodes should be discovered and be in the client's server list",
-                2,
-                jestClient.getServerPoolSize()
-        );
-
-        jestClient.shutdownClient();
-    }
-
-
     @Test
     public void testIdleConnectionReaper() throws Exception {
         internalCluster().ensureAtLeastNumDataNodes(3);
diff --git a/jest/src/test/java/io/searchbox/client/JestClientFactoryTest.java b/jest/src/test/java/io/searchbox/client/JestClientFactoryTest.java
index 38104dd0..6bb93fe1 100755
--- a/jest/src/test/java/io/searchbox/client/JestClientFactoryTest.java
+++ b/jest/src/test/java/io/searchbox/client/JestClientFactoryTest.java
@@ -5,14 +5,9 @@ import io.searchbox.client.config.HttpClientConfig;
 import io.searchbox.client.config.discovery.NodeChecker;
 import io.searchbox.client.http.JestHttpClient;
 import org.apache.http.HttpHost;
-import org.apache.http.auth.AuthScope;
-import org.apache.http.auth.UsernamePasswordCredentials;
-import org.apache.http.client.CredentialsProvider;
 import org.apache.http.client.config.RequestConfig;
-import org.apache.http.client.protocol.HttpClientContext;
 import org.apache.http.conn.HttpClientConnectionManager;
 import org.apache.http.conn.routing.HttpRoute;
-import org.apache.http.impl.client.BasicCredentialsProvider;
 import org.apache.http.impl.conn.BasicHttpClientConnectionManager;
 import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
 import org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager;
@@ -99,7 +94,7 @@ public class JestClientFactoryTest {
     }
 
     @Test
-    public void clientCreationWithDiscoveryAndOverriddenNodeChecker() {
+    public void clientCreationWithDiscoveryAndOverridenNodeChecker() {
         JestClientFactory factory = Mockito.spy(new ExtendedJestClientFactory());
         HttpClientConfig httpClientConfig = Mockito.spy(new HttpClientConfig.Builder("http://localhost:9200")
                 .discoveryEnabled(true)
@@ -115,26 +110,6 @@ public class JestClientFactoryTest {
                                                                     Mockito.same(httpClientConfig));
     }
 
-    @Test
-    public void clientCreationWithPreemptiveAuth() {
-        JestClientFactory factory = new JestClientFactory();
-        CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
-        credentialsProvider.setCredentials(AuthScope.ANY, new UsernamePasswordCredentials("someUser", "somePassword"));
-        HttpHost targetHost = new HttpHost("targetHostName", 80, "http");
-
-        HttpClientConfig httpClientConfig = new HttpClientConfig.Builder("someUri")
-                .credentialsProvider(credentialsProvider)
-                .setPreemptiveAuth(targetHost)
-                .build();
-
-        factory.setHttpClientConfig(httpClientConfig);
-        JestHttpClient jestHttpClient = (JestHttpClient) factory.getObject();
-        HttpClientContext httpClientContext = jestHttpClient.getHttpClientContextTemplate();
-
-        assertNotNull(httpClientContext.getAuthCache().get(targetHost));
-        assertEquals(credentialsProvider, httpClientContext.getCredentialsProvider());
-    }
-
     class ExtendedJestClientFactory extends JestClientFactory {
         @Override
         protected NodeChecker createNodeChecker(JestHttpClient client, HttpClientConfig httpClientConfig) {
diff --git a/jest/src/test/java/io/searchbox/client/config/HttpClientConfigTest.java b/jest/src/test/java/io/searchbox/client/config/HttpClientConfigTest.java
index f2347a1d..54e9df56 100644
--- a/jest/src/test/java/io/searchbox/client/config/HttpClientConfigTest.java
+++ b/jest/src/test/java/io/searchbox/client/config/HttpClientConfigTest.java
@@ -1,6 +1,5 @@
 package io.searchbox.client.config;
 
-import org.apache.http.HttpHost;
 import org.apache.http.auth.AuthScope;
 import org.apache.http.auth.Credentials;
 import org.apache.http.client.CredentialsProvider;
@@ -9,7 +8,6 @@ import org.junit.Test;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
 
 /**
  * @author cihat keser
@@ -52,26 +50,4 @@ public class HttpClientConfigTest {
         assertEquals(customCredentialsProvider, httpClientConfig.getCredentialsProvider());
     }
 
-    @Test
-    public void preemptiveAuth() {
-        String hostName = "targetHost";
-        int port = 80;
-
-        HttpClientConfig httpClientConfig = new HttpClientConfig.Builder("localhost")
-                .defaultCredentials("someUser", "somePassword")
-                .setPreemptiveAuth(new HttpHost(hostName, port, "http"))
-                .build();
-
-        assertEquals(hostName, httpClientConfig.getPreemptiveAuthTargetHost().getHostName());
-        assertEquals(port, httpClientConfig.getPreemptiveAuthTargetHost().getPort());
-    }
-
-    @Test(expected = IllegalArgumentException.class)
-    public void preemptiveAuthWithoutCredentials() {
-        new HttpClientConfig.Builder("localhost")
-                .setPreemptiveAuth(new HttpHost("localhost", 80, "http"))
-                .build();
-        fail("Builder should have thrown an exception if preemptive authentication is set without setting credentials");
-    }
-
 }
\ No newline at end of file
diff --git a/jest/src/test/java/io/searchbox/client/http/JestHttpClientTest.java b/jest/src/test/java/io/searchbox/client/http/JestHttpClientTest.java
index 21fdd8dc..5093a589 100755
--- a/jest/src/test/java/io/searchbox/client/http/JestHttpClientTest.java
+++ b/jest/src/test/java/io/searchbox/client/http/JestHttpClientTest.java
@@ -7,11 +7,8 @@ import io.searchbox.client.http.apache.HttpGetWithEntity;
 import io.searchbox.core.Search;
 import org.apache.http.Header;
 import org.apache.http.HttpVersion;
-import org.apache.http.client.AuthCache;
-import org.apache.http.client.CredentialsProvider;
 import org.apache.http.client.entity.GzipCompressingEntity;
 import org.apache.http.client.methods.*;
-import org.apache.http.client.protocol.HttpClientContext;
 import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.message.BasicStatusLine;
 import org.junit.After;
@@ -23,8 +20,6 @@ import java.io.IOException;
 import java.io.UnsupportedEncodingException;
 
 import static junit.framework.Assert.*;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 import static org.mockito.Matchers.any;
 import static org.mockito.Matchers.argThat;
@@ -163,22 +158,4 @@ public class JestHttpClientTest {
         }));
     }
 
-    @Test
-    public void createContextInstanceWithPreemptiveAuth() {
-        AuthCache authCacheMock = mock(AuthCache.class);
-        CredentialsProvider credentialsProviderMock = mock(CredentialsProvider.class);
-
-        HttpClientContext httpClientContextTemplate = HttpClientContext.create();
-        httpClientContextTemplate.setAuthCache(authCacheMock);
-        httpClientContextTemplate.setCredentialsProvider(credentialsProviderMock);
-
-        JestHttpClient jestHttpClient = (JestHttpClient) new JestClientFactory().getObject();
-        jestHttpClient.setHttpClientContextTemplate(httpClientContextTemplate);
-
-        HttpClientContext httpClientContextResult = jestHttpClient.createContextInstance();
-
-        assertEquals(authCacheMock, httpClientContextResult.getAuthCache());
-        assertEquals(credentialsProviderMock, httpClientContextResult.getCredentialsProvider());
-    }
-
 }
diff --git a/jest/src/test/java/io/searchbox/core/SearchScrollIntegrationTest.java b/jest/src/test/java/io/searchbox/core/SearchScrollIntegrationTest.java
index c6dbdf4b..5b2766ba 100644
--- a/jest/src/test/java/io/searchbox/core/SearchScrollIntegrationTest.java
+++ b/jest/src/test/java/io/searchbox/core/SearchScrollIntegrationTest.java
@@ -1,7 +1,10 @@
 package io.searchbox.core;
 
 import com.google.gson.JsonArray;
-
+import io.searchbox.client.JestResult;
+import io.searchbox.common.AbstractIntegrationTest;
+import io.searchbox.core.search.sort.Sort;
+import io.searchbox.params.Parameters;
 import org.elasticsearch.index.query.QueryBuilders;
 import org.elasticsearch.search.builder.SearchSourceBuilder;
 import org.elasticsearch.test.ESIntegTestCase;
@@ -9,11 +12,6 @@ import org.junit.Test;
 
 import java.io.IOException;
 
-import io.searchbox.client.JestResult;
-import io.searchbox.common.AbstractIntegrationTest;
-import io.searchbox.core.search.sort.Sort;
-import io.searchbox.params.Parameters;
-
 
 /**
  * @author ferhat
@@ -76,68 +74,7 @@ public class SearchScrollIntegrationTest extends AbstractIntegrationTest {
                 result.getJsonObject().getAsJsonObject("hits").getAsJsonArray("hits").size()
         );
 
-        // clear a single scroll id
-        ClearScroll clearScroll = new ClearScroll.Builder().addScrollId(scrollId).build();
-        result = client.execute(clearScroll);
-        assertTrue(result.getErrorMessage(), result.isSucceeded());
-    }
-
-    @Test
-    public void clearScrollAll() throws IOException {
-        assertTrue(index(INDEX, TYPE, "swvq1", "{\"code\":\"0\"}").isCreated());
-        assertTrue(index(INDEX, TYPE, "swvq2", "{\"code\":\"1\"}").isCreated());
-        assertTrue(index(INDEX, TYPE, "swvq3", "{\"code\":\"2\"}").isCreated());
-        refresh();
-        ensureSearchable(INDEX);
-
-        SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
-        searchSourceBuilder.query(QueryBuilders.matchAllQuery());
-
-        Search search = new Search.Builder(searchSourceBuilder.toString())
-            .addIndex(INDEX)
-            .addType(TYPE)
-            .addSort(new Sort("code"))
-            .setParameter(Parameters.SIZE, 1)
-            .setParameter(Parameters.SCROLL, "5m")
-            .build();
-        JestResult result = client.execute(search);
-        assertTrue(result.getErrorMessage(), result.isSucceeded());
-        JsonArray hits = result.getJsonObject().getAsJsonObject("hits").getAsJsonArray("hits");
-        assertEquals(
-            "only 1 document should be returned",
-            1,
-            hits.size()
-        );
-
-        String scrollId = result.getJsonObject().get("_scroll_id").getAsString();
-        for (int i = 1; i < 3; i++) {
-            SearchScroll scroll = new SearchScroll.Builder(scrollId, "5m")
-                .setParameter(Parameters.SIZE, 1).build();
-            result = client.execute(scroll);
-            assertTrue(result.getErrorMessage(), result.isSucceeded());
-            assertEquals("{\"code\":\"" + i + "\"}", result.getSourceAsString());
-            hits = result.getJsonObject().getAsJsonObject("hits").getAsJsonArray("hits");
-            assertEquals(
-                "only 1 document should be returned",
-                1,
-                hits.size()
-            );
-            scrollId = result.getJsonObject().getAsJsonPrimitive("_scroll_id").getAsString();
-        }
-
-        SearchScroll scroll = new SearchScroll.Builder(scrollId, "5m").build();
-        result = client.execute(scroll);
-        assertTrue(result.getErrorMessage(), result.isSucceeded());
-        assertEquals(
-            "no results should be left to scroll at this point",
-            0,
-            result.getJsonObject().getAsJsonObject("hits").getAsJsonArray("hits").size()
-        );
-
-        // clear all scroll ids
-        ClearScroll clearScroll = new ClearScroll.Builder().build();
-        result = client.execute(clearScroll);
-        assertTrue(result.getErrorMessage(), result.isSucceeded());
+        clearScroll(scrollId);
     }
 
 }
diff --git a/jest/src/test/java/io/searchbox/core/UpdateIntegrationTest.java b/jest/src/test/java/io/searchbox/core/UpdateIntegrationTest.java
index 3680b0ad..b6a10d5d 100644
--- a/jest/src/test/java/io/searchbox/core/UpdateIntegrationTest.java
+++ b/jest/src/test/java/io/searchbox/core/UpdateIntegrationTest.java
@@ -2,12 +2,9 @@ package io.searchbox.core;
 
 
 import io.searchbox.common.AbstractIntegrationTest;
-import org.elasticsearch.action.ActionFuture;
 import org.elasticsearch.action.get.GetResponse;
 import org.elasticsearch.action.index.IndexRequest;
-import org.elasticsearch.action.index.IndexResponse;
 import org.elasticsearch.index.get.GetResult;
-import org.elasticsearch.rest.RestStatus;
 import org.elasticsearch.test.ESIntegTestCase;
 import org.junit.Test;
 
@@ -77,82 +74,4 @@ public class UpdateIntegrationTest extends AbstractIntegrationTest {
         assertFalse(getResult.isSourceEmpty());
         assertEquals("blue", getResult.getSource().get("tags"));
     }
-
-    @Test
-    public void partialDocUpdateWithValidVersion() throws Exception {
-        String id = "2";
-        String partialDoc = "{\n" +
-                "    \"doc\" : {\n" +
-                "        \"tags\" : \"blue\"\n" +
-                "    }\n" +
-                "}";
-
-        IndexResponse response = client().index(
-                new IndexRequest(INDEX, TYPE, id)
-                        .source("{\"user\":\"kimchy\", \"tags\":\"That is test\"}")
-                        .refresh(true)
-        ).actionGet();
-        long version = response.getVersion();
-
-        DocumentResult result = client.execute(new Update.VersionBuilder(partialDoc, version)
-                .index(INDEX)
-                .type(TYPE)
-                .id(id)
-                .build());
-        assertTrue(result.getErrorMessage(), result.isSucceeded());
-        assertEquals(INDEX, result.getIndex());
-        assertEquals(TYPE, result.getType());
-        assertEquals(id, result.getId());
-        assertEquals(version + 1, result.getVersion().longValue());
-
-        GetResponse getResult = get(INDEX, TYPE, id);
-        assertTrue(getResult.isExists());
-        assertFalse(getResult.isSourceEmpty());
-        assertEquals("blue", getResult.getSource().get("tags"));
-    }
-
-    @Test
-    public void partialDocUpdateWithInvalidVersion() throws Exception {
-        String id = "2";
-        String partialDoc = "{\n" +
-                "    \"doc\" : {\n" +
-                "        \"tags\" : \"blue\"\n" +
-                "    }\n" +
-                "}";
-        String partialDoc2 = "{\n" +
-                "    \"doc\" : {\n" +
-                "        \"tags\" : \"red\"\n" +
-                "    }\n" +
-                "}";
-
-        IndexResponse response = client().index(
-                new IndexRequest(INDEX, TYPE, id)
-                        .source("{\"user\":\"kimchy\", \"tags\":\"That is test\"}")
-                        .refresh(true)
-        ).actionGet();
-        long version = response.getVersion();
-
-        DocumentResult result = client.execute(new Update.VersionBuilder(partialDoc, version)
-                .index(INDEX)
-                .type(TYPE)
-                .id(id)
-                .build());
-        assertTrue(result.getErrorMessage(), result.isSucceeded());
-
-        // and again ...
-        result = client.execute(new Update.VersionBuilder(partialDoc2, version)
-                .index(INDEX)
-                .type(TYPE)
-                .id(id)
-                .build());
-
-        assertFalse(result.getErrorMessage(), result.isSucceeded());
-        assertEquals("Invalid response code", RestStatus.CONFLICT.getStatus(), result.getResponseCode());
-
-        GetResponse getResult = get(INDEX, TYPE, id);
-        assertTrue(getResult.isExists());
-        assertEquals(version + 1, getResult.getVersion());
-        assertEquals("blue", getResult.getSource().get("tags"));
-    }
-
 }