Search code examples
solrsolrj

Solr: Retrieving the query from a QueryResponse


Given a QueryResponse object (SolrJ 3.6.2), is there any way to retrieve the query that was made to get that response other than parsing the query string?


Solution

  • QueryResponse exposes the Header information from which the q can be retrieved.

    rsp.getHeader().get("q")