我正在我们的应用程序中实现 SOLR 服务器。我们使用 SolrJ 包中的 CommonsHttpSolrServer 连接到使用 commons-httpclient 的 solr 服务器。我们也使用 Spring。
现在我们的系统管理员保护了 solr 服务器(有充分的理由)并使用了基本身份验证。
如何实例化具有基本身份验证的 HttpClient 以注入 SolrJ?
例如
<bean id="httpSolrServer" class="org.apache.solr.client.solrj.impl.CommonsHttpSolrServer">
<constructor-arg value="${solrserver_path}" />
<constructor-arg ref="solrHttpClient" />
</bean>
谢谢!