Sorting the response is not the problem. I need the whole data set (in this case, all the content of the Solr index) to be delivered to the client in a specific order. So my question is if Solr supports sorting of requested data on the server side, before delivering the data (in chunks) to the client (similar to adding an "order by" clause to an SQL query).
man. 17. mars 2025 kl. 14:42 skrev <mw...@iu.edu>: > On Mon, Mar 17, 2025 at 07:15:04AM +0000, Erik Dybdahl wrote: > > [You don't often get email from erik...@gmail.com. Learn why this is > important at https://aka.ms/LearnAboutSenderIdentification ] > > > > Hi, > > I need to do a complete export of a Solr index in a specific order, > sorted > > on a specific (non-unique) field. Is this possible? > > > > I've tried different approaches: > > Using /export request handler, I got " class java.util.LinkedHashMap > cannot > > be cast to class org.apache.solr.common.util.NamedList > > (java.util.LinkedHashMap" in BinaryResponseParser. processResponse. > > > > So, I tried a cursor-based approach, sorting on two fields, the > non-unique > > one which I want to have the result sorted on, plus the unique id field. > > However, the sorting is done on the result of each query, not on the > > complete data set. > > > > My current conclusion is that fetching all the data in a Solr index, in > > sorted order, is not possible. > > Am I right? > > If you are, you might consider feeding the response through an > external tool. XQuery or jq can do sorting. Or, if the result set is > very large, get it in CSV or TSV and run it through a dedicated sorter > that's designed for huge files, then convert it to the format you > want. (I typically use miller for converting and manipulating tabular > formats.) > > -- > Mark H. Wood > Lead Technology Analyst > > University Library > Indiana University Indianapolis > 755 W. Michigan Street > Indianapolis, IN 46202 > 317-274-0749 > library.indianapolis.iu.edu >