On 3/18/2019 2:04 PM, Markus Schuch wrote:
* CoreAdminRequest - is only working when no particular core is given
* PingRequest - is only working when a particular core is given
That sounds like what I would expect to happen.
Using HTTP (not SolrJ), the CoreAdmin API is accessed through a URL that
does NOT contain a core name in the URL path. If you initialize your
HttpSolrClient using a URL that contains the core name, you won't be
able to use that client for CoreAdmin requests -- because CoreAdmin
requests do not use that kind of URL.
Similarly, the Ping handler is accessed through a URL that DOES contain
the core name in the URL path. You can use a client initialized without
a core name by providing the core name when you execute the request.
See the following code:
@Test
public void testPingWithoutCore() throws IOException,
SolrServerException {
String coreToTest = "techproducts";
HttpSolrClient client = new
HttpSolrClient.Builder().withBaseSolrUrl("http://localhost:8983/solr").build();
SolrPing ping = new SolrPing();
SolrPingResponse response = ping.process(client, coreToTest);
assertEquals(0, response.getStatus());
}