try (AuthorizedSolrClient<HttpSolrClient> client = spec.getConnectionConfiguration().createClient(replica.baseUrl())) { SchemaRequest.UniqueKey request = new SchemaRequest.UniqueKey(); try { SchemaResponse.UniqueKeyResponse response = client.process(spec.getCollection(), request);
public String getUniqueKey(String collectionName) throws IOException, SolrServerException { SchemaRequest.UniqueKey keyRequest = new SchemaRequest.UniqueKey(); SchemaResponse.UniqueKeyResponse keyResponse = keyRequest.process(getClient(), collectionName); return keyResponse.getUniqueKey(); }