java - Get request url from solrj -


i using solrj query index , @ times kick off reindex.

we having server issues, want verify url solrj constructing. have tried:

public void indexsolr() throws solrserverexception, ioexception {     httpsolrserver solr = new httpsolrserver(solrindexpath);     logger.info("indexing cp solr @ " + solrindexpath);      // reindex 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 in last line. getrequesturl() null. know solrj indeed calling solr, because in fact kick off index request (most of time).

how can intercept or retrieve url solrj constructing request?

as described in how can transform solrquery(solrj) url? can use clientutils.toquerystring matter.

in javadoc can see helper methods accepts solrparams input, have. full url need concatenate solrindexpath have in code sample.

system.out.println(solrindexpath + clientutils.toquerystring(params, false)); 

should trick.


Popular posts from this blog