I am using to solrj to query an index and at times kick off a reindex.
We are having some server issues, so I want to verify the url solrj is constructing. This is what I have tried:
public void indexSolr() throws SolrServerException, IOException {
HttpSolrServer solr = new HttpSolrServer(solrIndexPath);
logger.info("Indexing cp solr at " + solrIndexPath);
// reindex to pickup new articles
ModifiableSolrParams params = new ModifiableSolrParams();
params.set("qt", "/" + solrDataImportPath);
params.set("command", "full-import");
params.set("clean", "true");
params.set("commit", "true");
QueryResponse response = solr.query(params);
logger.info("index url: " + response.getRequestUrl());
}
The problem is in that last line. getRequestUrl()
is always null. I know solrj is indeed calling solr, because it does in fact kick off an index request (most of the time).
How can I intercept or retrieve the url solrj is constructing for my request?