|
|
@ -21,7 +21,7 @@ import java.util.Optional;
|
|
|
|
|
|
|
|
|
|
|
|
import org.apache.solr.client.solrj.SolrClient;
|
|
|
|
import org.apache.solr.client.solrj.SolrClient;
|
|
|
|
import org.apache.solr.client.solrj.impl.CloudSolrClient;
|
|
|
|
import org.apache.solr.client.solrj.impl.CloudSolrClient;
|
|
|
|
import org.apache.solr.client.solrj.impl.Http2SolrClient;
|
|
|
|
import org.apache.solr.client.solrj.impl.HttpSolrClient;
|
|
|
|
|
|
|
|
|
|
|
|
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
|
|
|
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
|
|
|
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
|
|
|
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
|
|
@ -38,7 +38,7 @@ import org.springframework.util.StringUtils;
|
|
|
|
* @since 1.1.0
|
|
|
|
* @since 1.1.0
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@AutoConfiguration
|
|
|
|
@AutoConfiguration
|
|
|
|
@ConditionalOnClass({ Http2SolrClient.class, CloudSolrClient.class })
|
|
|
|
@ConditionalOnClass({ HttpSolrClient.class, CloudSolrClient.class })
|
|
|
|
@EnableConfigurationProperties(SolrProperties.class)
|
|
|
|
@EnableConfigurationProperties(SolrProperties.class)
|
|
|
|
public class SolrAutoConfiguration {
|
|
|
|
public class SolrAutoConfiguration {
|
|
|
|
|
|
|
|
|
|
|
@ -48,7 +48,7 @@ public class SolrAutoConfiguration {
|
|
|
|
if (StringUtils.hasText(properties.getZkHost())) {
|
|
|
|
if (StringUtils.hasText(properties.getZkHost())) {
|
|
|
|
return new CloudSolrClient.Builder(Arrays.asList(properties.getZkHost()), Optional.empty()).build();
|
|
|
|
return new CloudSolrClient.Builder(Arrays.asList(properties.getZkHost()), Optional.empty()).build();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return new Http2SolrClient.Builder(properties.getHost()).build();
|
|
|
|
return new HttpSolrClient.Builder(properties.getHost()).build();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|