根据Solr文档,您可以使用以下语法为分布式搜索添加"shards"参数:
主机:端口/base_url[,主机:端口/base_url]
如何告诉 Solr 使用 https://?
所以答案位于 solrconfig.xml 的核心:
<shardHandlerFactory class="HttpShardHandlerFactory">
<str name="urlScheme">https://</str>
</shardHandlerFactory>
在查询中定义分片时
例如 &shards=192.168.0.1:8983/solr/core,192.168.0.2:8983/solr/core
shardHandlerFactory 将为每个服务器添加指定值的前缀
在我们的例子中https://192.168.0.1:8983/solr/core
和https://192.168.0.2:8983/solr/core
.