Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
258 views
in Technique[技术] by (71.8m points)

java - How can I get a list of all the cores in a solr server using SolrJ

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.

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...