I have added XSLT file to format my results in Apache solr.
By navigating to the following URL, the results are coming as expected, after the XSLT transformation:
http://localhost:8983/solr/en_US/select?callback=jsonCallback&sort=articleDate%20desc&q=*:*&wt=xslt&tr=ra.xsl
I need to achieve the same thing using Solrj API. I am not able to transform the result using Solrj API in Java.
SolrServer solrServer = new HttpSolrServer("http://localhost:8983/solr/en_US");
NamedList<Object> params = new NamedList<Object>();
params.add("wt", "xslt");
params.add("tr", "ra.xsl");
SolrQuery query = new SolrQuery();
query.add(ModifiableSolrParams.toSolrParams(params));
query.setQuery("*:*");
query.addSort("articleDate",SolrQuery.ORDER.desc);
QueryResponse response = solrServer.query(query);
SolrDocumentList results = response.getResults();
I am setting the parameters as above. Please help me to achieve getting the same response using Solrj API.