2

I have a collection in SOLR named sample, and I am trying to do some grouping on the collection by running the below query

http://127.0.0.1:8983/solr/sample/select?q=*%3A*&wt=json&indent=true&facet=true&facet.pivot=Key1,Key2

This gives me correct result, with facet_counts after the search result.

But what I would like to have is the facet result in a .csv format. I tried setting wt=csv but that gives me only the search result in csv, not the facet part.

Is there any way to get the facet result also in csv format?

Thanks

vishnu viswanath
  • 3,794
  • 2
  • 36
  • 47

1 Answers1

3

Not directly. The CSV Response Writer only includes (as you've discovered) information about the actual documents (as the CSV format isn't suited for different data schemas in a single file).

Solr does however have an XSLT response writer, where you can apply a custom XSL transformation to the reply, allowing you to turn the default outputted XML into any format you want, including as a CSV response. I don't have a ready example of how to do that, but the question has been asked before (for XML => CSV with XSLT).

Community
  • 1
  • 1
MatsLindh
  • 49,529
  • 4
  • 53
  • 84