SolrJConfiguration.java 505 Bytes
package org.legrog.configuration;

import org.apache.solr.client.solrj.SolrClient;
import org.apache.solr.client.solrj.impl.HttpSolrClient;

import javax.enterprise.inject.Produces;

/**
 * SolrJ configuration class
 */
public class SolrJConfiguration {

    /**
     * injectable SolrClient for classes that need it
     *
     * @return SolrClient
     */
    @Produces
    public SolrClient createSolrClient() {
        return new HttpSolrClient.Builder("http://localhost:8983/solr").build();
    }

}