// Path: src/main/java/org/xbib/elasticsearch/action/search/helper/BasicGetRequest.java
// public class BasicGetRequest {
// 
//     private final ESLogger logger = ESLoggerFactory.getLogger(BasicGetRequest.class.getName());
// 
//     private GetRequestBuilder getRequestBuilder;
// 
//     private String index;
// 
//     private String type;
// 
//     private String id;
// 
//     public BasicGetRequest newRequest(GetRequestBuilder getRequestBuilder) {
//         this.getRequestBuilder = getRequestBuilder;
//         return this;
//     }
// 
//     public GetRequestBuilder getRequestBuilder() {
//         return getRequestBuilder;
//     }
// 
//     public BasicGetRequest index(String index) {
//         if (index != null && !"*".equals(index)) {
//             this.index = index;
//         }
//         return this;
//     }
// 
//     public String index() {
//         return index;
//     }
// 
//     public BasicGetRequest type(String type) {
//         if (type != null && !"*".equals(type)) {
//             this.type = type;
//         }
//         return this;
//     }
// 
//     public String type() {
//         return type;
//     }
// 
//     public BasicGetRequest id(String id) {
//         this.id = id;
//         return this;
//     }
// 
//     public String id() {
//         return id;
//     }
// 
//     public BasicGetResponse execute() throws IOException {
//         BasicGetResponse response = new BasicGetResponse();
//         if (getRequestBuilder == null) {
//             return response;
//         }
//         logger.info(" get request: {}/{}/{}",
//                 getRequestBuilder.request().index(),
//                 getRequestBuilder.request().type(),
//                 getRequestBuilder.request().id());
//         getRequestBuilder
//                 .setIndex(index)
//                 .setType(type)
//                 .setId(id);
//         long t0 = System.currentTimeMillis();
//         response.setResponse(getRequestBuilder.execute().actionGet());
//         long t1 = System.currentTimeMillis();
//         logger.info(" get request complete: {}/{}/{} [{}ms] {}",
//                 getRequestBuilder.request().index(),
//                 getRequestBuilder.request().type(),
//                 getRequestBuilder.request().id(),
//                 (t1 - t0), response.exists());
//         return response;
//     }
// 
// }


import org.elasticsearch.client.Client;
import org.elasticsearch.client.transport.NoNodeAvailableException;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.transport.InetSocketTransportAddress;
import org.xbib.elasticsearch.action.search.helper.BasicGetRequest;
import org.xbib.elasticsearch.action.search.helper.BasicSearchRequest;
import java.io.IOException;
import java.util.Collection;
import java.util.Map;
    }

    @Override
    public SearchTransportClient init(Map<String, String> settings) throws IOException {
        init(Settings.builder().put(settings).build());
        return this;
    }

    @Override
    public SearchTransportClient init(Settings settings) throws IOException {
        super.createClient(settings);
        Collection<InetSocketTransportAddress> addrs = findAddresses(settings);
        if (!connect(addrs, settings.getAsBoolean("autodiscover", false))) {
            throw new NoNodeAvailableException("no cluster nodes available, check settings "
                    + settings.getAsMap());
        }
        return this;
    }

    public Client client() {
        return client;
    }

    @Override
    public BasicSearchRequest newSearchRequest() {
        return new BasicSearchRequest()
                .newRequest(client.prepareSearch());
    }

    @Override
// Path: src/main/java/org/xbib/elasticsearch/action/search/helper/BasicGetRequest.java
// public class BasicGetRequest {
// 
//     private final ESLogger logger = ESLoggerFactory.getLogger(BasicGetRequest.class.getName());
// 
//     private GetRequestBuilder getRequestBuilder;
// 
//     private String index;
// 
//     private String type;
// 
//     private String id;
// 
//     public BasicGetRequest newRequest(GetRequestBuilder getRequestBuilder) {
//         this.getRequestBuilder = getRequestBuilder;
//         return this;
//     }
// 
//     public GetRequestBuilder getRequestBuilder() {
//         return getRequestBuilder;
//     }
// 
//     public BasicGetRequest index(String index) {
//         if (index != null && !"*".equals(index)) {
//             this.index = index;
//         }
//         return this;
//     }
// 
//     public String index() {
//         return index;
//     }
// 
//     public BasicGetRequest type(String type) {
//         if (type != null && !"*".equals(type)) {
//             this.type = type;
//         }
//         return this;
//     }
// 
//     public String type() {
//         return type;
//     }
// 
//     public BasicGetRequest id(String id) {
//         this.id = id;
//         return this;
//     }
// 
//     public String id() {
//         return id;
//     }
// 
//     public BasicGetResponse execute() throws IOException {
//         BasicGetResponse response = new BasicGetResponse();
//         if (getRequestBuilder == null) {
//             return response;
//         }
//         logger.info(" get request: {}/{}/{}",
//                 getRequestBuilder.request().index(),
//                 getRequestBuilder.request().type(),
//                 getRequestBuilder.request().id());
//         getRequestBuilder
//                 .setIndex(index)
//                 .setType(type)
//                 .setId(id);
//         long t0 = System.currentTimeMillis();
//         response.setResponse(getRequestBuilder.execute().actionGet());
//         long t1 = System.currentTimeMillis();
//         logger.info(" get request complete: {}/{}/{} [{}ms] {}",
//                 getRequestBuilder.request().index(),
//                 getRequestBuilder.request().type(),
//                 getRequestBuilder.request().id(),
//                 (t1 - t0), response.exists());
//         return response;
//     }
// 
// }


// Path: src/main/java/org/xbib/elasticsearch/helper/client/SearchTransportClient.java
import org.elasticsearch.client.Client;
import org.elasticsearch.client.transport.NoNodeAvailableException;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.transport.InetSocketTransportAddress;
import org.xbib.elasticsearch.action.search.helper.BasicGetRequest;
import org.xbib.elasticsearch.action.search.helper.BasicSearchRequest;
import java.io.IOException;
import java.util.Collection;
import java.util.Map;

    }

    @Override
    public SearchTransportClient init(Map<String, String> settings) throws IOException {
        init(Settings.builder().put(settings).build());
        return this;
    }

    @Override
    public SearchTransportClient init(Settings settings) throws IOException {
        super.createClient(settings);
        Collection<InetSocketTransportAddress> addrs = findAddresses(settings);
        if (!connect(addrs, settings.getAsBoolean("autodiscover", false))) {
            throw new NoNodeAvailableException("no cluster nodes available, check settings "
                    + settings.getAsMap());
        }
        return this;
    }

    public Client client() {
        return client;
    }

    @Override
    public BasicSearchRequest newSearchRequest() {
        return new BasicSearchRequest()
                .newRequest(client.prepareSearch());
    }

    @Override
    public BasicGetRequest newGetRequest() {