Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.englishtown.vertx.solr.impl;
 
Default implementation of com.englishtown.vertx.solr.SolrService
public class DefaultSolrService implements SolrService {
    private final SolrConfigurator configurator;
    private VertxSolrClient solrClient;
    @Inject
    public DefaultSolrService(SolrConfigurator configurator) {
        this. = configurator;
    }
    @Override
    public void start() {
    }
    @Override
    public void stop() {
        if ( != null) {
            .stop();
             = null;
        }
    }
    @Override
    public void query(JsonObject queryQueryOptions optionsHandler<AsyncResult<JsonObject>> resultHandler) {
        query(new VertxSolrQuery(query), optionsresultHandler);
    }
    @Override
    public void query(VertxSolrQuery queryQueryOptions optionsHandler<AsyncResult<JsonObject>> resultHandler) {
        if (options == null) {
            options = new QueryOptions();
        } else {
            if (options.getBasicAuthUser() != null && options.getBasicAuthPass() != null) {
                query.set(.options.getBasicAuthUser());
                query.set(.options.getBasicAuthPass());
            }
        }
        try {
            QueryRequest request = new QueryRequest(query);
            if (options.getCore() != null) {
                request.setPath("/" + options.getCore() + "/select");
            }
            .request(requestresultHandler);
        } catch (Throwable t) {
            resultHandler.handle(Future.failedFuture(t));
        }
    }
New to GrepCode? Check out our FAQ X