问题
SolrQuery query = new SolrQuery();
query.setQuery("*:*");
query.add("wt","csv");
server.query(query);
In QueryResponse object params come out to be params{q=:,wt=javabin,version=2}
Even though I have set wt as csv in code above . Any way how to get solr output in csv ?
回答1:
The solrj
Java library only supports javabin
and xml
.
You can use HttpSolrServer#setParser(ResponseParser processor)
to define the format. The wt
parameter won't work here.
If you want a csv output you have to manually transform the response from Solr to the csv format.
来源:https://stackoverflow.com/questions/29015996/i-want-output-to-be-in-csv-when-i-query-solr-but-output-still-comes-in-javabin