如何使用 SolrJ 获取 solr 服务器中所有内核的列表 [英] How can I get a list of all the cores in a solr server using SolrJ

查看:27
本文介绍了如何使用 SolrJ 获取 solr 服务器中所有内核的列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们使用 Solr 进行搜索,并将数据分片到多个核心.我们每周有一个核心数据,因此我们每周动态地创建和删除核心.

We are using Solr for our searches, and sharding the data across several cores. We have one core per week of data, so we are dynamically creating and deleting cores each week.

如何查询 solr 服务器以获取其所有内核的列表?JavaDoc 说我可以使用 coreAdminHandler.getCoreContainer().getCoreNames(),但我不确定如何构建 coreAdminHandler 对象.

How can I query a solr server for a list of all its cores? The JavaDoc says I can use coreAdminHandler.getCoreContainer().getCoreNames(), but I'm not sure how to build a coreAdminHandler object.

推荐答案

A request to http://localhost:8983/solr/admin/cores?action=STATUS(替换你自己的主机/端口当然)将返回所有内核.

A request to http://localhost:8983/solr/admin/cores?action=STATUS (replace your own host/port of course) will return all cores.

这篇关于如何使用 SolrJ 获取 solr 服务器中所有内核的列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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