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

 <fields>
   <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" />
 </fields>

cistring is a case-insensitive string type i created:

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

Reply via email to