SolrCloud分布式检索时显示每个shard的响应速度

想看看每个 shards 返回的时间,来方便设置 HttpShardHandlerFactory。

使用参数

可以使用 shards.info 参数来查看每个 shard 的响应信息。

参数详解

当在查询中添加 shards.info=true 参数时,Solr 会在响应中返回每个 shard 的详细信息,包括:

  • 响应时间
  • 处理的文档数量
  • 查询执行状态

配置示例

1
http://localhost:8983/solr/collection1/select?q=*:*&shards.info=true

响应格式

返回的响应中会包含类似以下的信息:

1
2
3
4
5
6
7
8
<lst name="shards.info">
<lst name="shard1">
<long name="numFound">1000</long>
<int name="maxScore">1.0</int>
<long name="shardAddress">http://localhost:8983/solr</long>
<long name="time">45</long>
</lst>
</lst>

通过这些信息可以分析各个 shard 的性能表现,进而优化 HttpShardHandlerFactory 的配置。

© 2025 Solr Community of China All Rights Reserved. 本站访客数人次 本站总访问量
Theme by hiero