First, you can't sort on text fields, assuming that by "text" you're talking about tokenized fields.
Typically, people use copyField to copy these fields into a non-tokenized string, usually normalized to, for instance, make everything lowercase and sort on _that_. Note, you're not _displaying_ the sort field, just sorting on it. Then, before doing some fancy custom stuff, I'd just try sorting on these fields. There's no problem specifying multiple sort fields. As &sort=field1 asc,field2 desc..... If you include a filter query to restrict the search to customers, then of course you'll just get the results viewable for that customer. Best Erick On Fri, Jun 22, 2012 at 2:00 AM, Alok Bhandari <alokomprakashbhand...@gmail.com> wrote: > Hello, > > the requirement which I have is that on solr side we have indexed data of > multiple customers and each customer we have at least a million documents. > After executing search end user want to sort on some fields on datagrid lets > say subject, title, date etc. > > Now as the sorting on text fields is costlier what optimisation I can do for > that, I am thinking of following options > > 1)Create a custom cache and for each customer hold the list of documents in > sorted order of each of the field on which we want to sort . So that when > request for sorting comes from the user I can return a list from cache > > 2)Use filter query cache , where customer id criteria is added so that each > time I get the docs from filter cache > > Please can anybody tell me whether this is the good approach or there is > some better way of doing this? > I am using solr 3.6. > > Thanks in advance. > > > -- > View this message in context: > http://lucene.472066.n3.nabble.com/How-can-I-optimize-Sorting-on-multiple-text-fields-tp3990874.html > Sent from the Solr - User mailing list archive at Nabble.com.