lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jon Drukman <>
Subject Sorting - bad performance
Date Tue, 22 Feb 2011 19:44:19 GMT
The performance factors wiki says:
"If you do a lot of field based sorting, it is advantageous to add explicitly
warming queries to the "newSearcher" and "firstSearcher" event listeners in your
solrconfig which sort on those fields, so the FieldCache is populated prior to
any queries being executed by your users."

I've got an index with 24+ million docs of forum posts from users.  I want to be
able to get a given user's posts sorted by date.  It's taking 20 seconds right
now.  What would I put in the newSearch/firstSearcher to make that quicker?  Is
there any other general approach I can use to speed up sorting?

The schema looks like

   <field name="type_id" type="string" indexed="true" stored="true"
required="true" />
   <field name="subhead" type="text" indexed="true" stored="true"/>
   <field name="post_date" type="date" indexed="true" stored="true" />
   <field name="author" type="cistring" indexed="true" stored="true" />
   <field name="parent_author" type="cistring" indexed="true" stored="true" />

cistring is a case-insensitive string type i created:

   <fieldType name="cistring" class="solr.StrField" sortMissingLast="true"
        <analyzer type="index">
                <tokenizer class="solr.LowerCaseTokenizerFactory"/>
        <analyzer type="query">
                <tokenizer class="solr.LowerCaseTokenizerFactory"/>

View raw message