3
votes

I am trying to specify sort on a String field in my query but seeing memory issues since the index has around 50M docs.

Why is that Solr actually sorts the field values for all the documents in the index and NOT just the hits returned from the query. Is there an alternative to these performance problems.

1
Can you please show your request?ffriend
Here it is... q=-uid:XXX+%2B(fid:XXX)&sort=firstName%20asc SolrQuery result = new SolrQuery(); result.setFields("uid,score,firstName"); . . . . . . result.setQuery(query.toString()); result.setSortField("firstName", ORDER.asc);Satya
How many documents are in your index and how many are satisfied by the query?kellyfj

1 Answers

1
votes

For your query, it may be faster to use filter queries.

q=*:*&fq=-uid:XXX&fq=%2B(fid:XXX)&sort=firstName%20asc

http://wiki.apache.org/solr/CommonQueryParameters