Solr 在 Https 上运行 - SolrJ 连接问题 [英] Solr running on Https - SolrJ Connection issue

查看:25
本文介绍了Solr 在 Https 上运行 - SolrJ 连接问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 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 内部使用 Apache Http客户.当使用 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 构造函数.检查它的 API 接受 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 客户端 SSL指南.

You can see the following guide, on how to create SSL enabled http client SSL Guide.

这应该会有所帮助.

这篇关于Solr 在 Https 上运行 - SolrJ 连接问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆