繁体   English   中英

Apache solr 使用分片分发搜索不起作用(shardsWhitelist)

[英]Apache solr distributes search using shards are not working (shardsWhitelist)

I have installed latest solr and creates multiple cores called Unicore and SAP core and as per the SOLR configurations of solr 8.7 distributed search we need to add the following code in the respective confgiurations directories solrconfig.xml file, below solrconfig.xml from Unicore conf

<requestHandler name="/select" class="solr.SearchHandler">
  <!-- other params go here -->
  <shardHandlerFactory class="HttpShardHandlerFactory">
    <int name="socketTimeout">1000</int>
    <int name="connTimeout">5000</int>
    <str name="shardsWhitelist">localhost:8983/solr/SAP</str>
  </shardHandlerFactory>
</requestHandler>

我用来从分片收集数据的查询:

http://localhost:8983/solr/UniCore/select?q=text:searchString&wt=json&indent=true&shards=localhost:8983/solr/SAP

发现以下问题:

在此处输入图像描述

我确实google了很多,但仍然无法找到解决方案。 参考stackverflow问题

Modfify solr.xml under solr server directory => update this file by adding core names into shardsWhitelist in the solsInstance\Server\solr\solr.xml and restart solr. 这适用于SOLR-8.7版本。

<!-- shardsWhiltlisting SAP core for distributed search -->

<shardHandlerFactory name="shardHandlerFactory"
    class="HttpShardHandlerFactory">
    <int name="socketTimeout">${socketTimeout:600000}</int>
    <int name="connTimeout">${connTimeout:60000}</int>
    <str name="shardsWhitelist">${solr.shardsWhitelist:hostName:8983/solr/SAP}</str> 
  </shardHandlerFactory>

为所有需要的核心配置 HttpShardHanldeFactory shardsWhiltlist

<str name="shardsWhitelist">${solr.shardsWhitelist:hostName:port/solr/core1,
hostName:port/solr/core2,.., solr.shardsWhitelist:hostName:port/solr/coren,}</str>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM