问题描述
我在tomcat顶部的Https(8443)端口运行Solr,如何使用solrj客户端访问该solr,我只能看到CommonsHttpSolrServer可用,
Am running Solr in Https(8443) port on top of tomcat, How can i access that solr using solrj client, I can see only CommonsHttpSolrServer is availble,
请问是否有办法使用SolrJ访问启用https端口的solr?
Please suggest is there any way to access the https port enabled solr using SolrJ?.
推荐答案
Solrj内部使用。当使用 CommonsHttpSolrServer
时,它将创建一个&使用它,如果你没有提供它。
Solrj internally uses Apache Http Client. When using CommonsHttpSolrServer
it will create one & use it, if you are not providing it with one.
在这种情况下,由于您需要SSL支持,您可以将自己的SSL配置HttpClient提供给 CommonsHttpSolrServer
构造函数。检查其接受HttpClient。
In this case since you need support for SSL you could provide your own SSL configured HttpClient to CommonsHttpSolrServer
constructor. Check its API that accepts HttpClient.
CommonsHttpSolrServer(String solrServerUrl, HttpClient sslHttpClient, ...
您可以看到以下指南,介绍如何创建启用SSL的http客户端。
You can see the following guide, on how to create SSL enabled http client SSL Guide.
这应该会有所帮助。
这篇关于Solr在Https - SolrJ Connection问题上运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!