Search code examples
javasolrlucenesolrjinformation-retrieval

SolrJ client - Preview request before sending


Is there a way to view the request the client is about to send to the server? For instance:

SolrQuery solrQuery = new SolrQuery(query);
solrQuery.setRows(rows);
solrQuery.setIncludeScore(true);

solrQuery.setParam("defType","edismax");
solrQuery.setParam("debugQuery", "true");

// would like to preview the current built up request here
QueryResponse resp = _server.query(solrQuery);

Solution

  • SolrQuery.toString method gives all the parameters which you can log.