Hi Adeel, I would use the first approach since it is more flexible and easier to use. Please consider XsltResponseWriter which allows to transform result set from Solr's default xml structure into custom using provided xslt template.
Myron 2010/9/23 Adeel Qureshi <adeelmahm...@gmail.com> > This probably isnt directly a solr user type question but its close enough > so I am gonna post it here. I have been using solr for a few months now and > it works just out of this world so I definitely love the software (and > obviously lucene too) .. but I feel that solr output xml is in kind of > weird > format .. I mean its in a format that simply makes it difficult to plug > solr > output xml in any xml reading tool or api .. this whole concept of using > <str name="id">123</str> > instead of > <id>123</id> > doesnt makse sense to me .. > > what I am trying to do now is setup a reporting system off of solr .. and > the concept is simply .. let the user do all the searches, facet etc and > once they have finalized on some results .. simply allow them to export > those results in an excel or pdf file .. what I have setup right now is I > simply let the export feature use the same solr query that user used to > search their results .. send that query to solr again and get all results > back and simply iterate over xml and dump all data in an excel file > > this has worked fine in most situations but I want to improve this process > and specifically use jasper reports for reporting .. and I want to use > ireport to design my report templates .. > thats where solr output xml format is causing problems .. as I cant figure > out how to make it work with ireport because of solr xml not having any > named nodes .. it all looks like the same nodes and ireport cant > distinguish > one column from another .. so I am thinking a couple of solutions here and > wanted to get some suggestions from you guys on how to do it best > > 1. receive solr output xml .. convert it to a more readable xml form .. use > named nodes instead of nodes by data type > <str name="id">123</str> > <str name="title">xyz</str> > > => > <id>123</id> > <title>xyz</title> > > and then feed that to jasper report template > > 2. use solrJ to recieve solr output in the NamedList resultset as it > returns > ..I havent tried this method so I am not sure how useful or easy to work, > this NamedList structure is .. in this I would be feeding Collection of > NamedList items to jasper .. havent played around with this so not sure how > well its gonna work out .. if you have tried something like this please let > me know how it worked out for u > > I would appreciate absolutely any kind of comments on this > > Thanks > Adeel >