Search code examples
cachingsolrconfigurationwarm-up

solr query warmup troubles and solrconfig.xml


I am trying to configure warmup queries in solrconfig.xml on Solr version 4.10.3, but no matter how we do it the cache seems to disappear after about a minute or so, and then the first search again takes about 20 secs., with subsequent searches coming straight away.

The query looks like this (filter is the variable search-term):

solr/Nyheder/select?q=overskrift:" & filter & "+OR+underrubrik:" & filter & "+OR+tekst:" & filter&fl=id+oprettet+overskrift+underrubrik+tekst+pix &sort=oprettet+desc

And the solrConfig.xml section (which seems to help nothing) looks like this (it is similar for the event="firstSearcher"):

<listener event="newSearcher" class="solr.QuerySenderListener">
  <arr name="queries">
         <lst>
    <str name="q">*:*</str>
    <str name="sort">oprettet desc</str>
    <str name="fl">id oprettet overskrift underrubrik tekst pix</str>
   </lst>
       <lst>
    <str name="q">overskrift:* OR underrubrik:* OR tekst:*</str>
    <str name="sort">oprettet desc</str>
    <str name="fl">id oprettet overskrift underrubrik tekst pix</str>
   </lst>
  </arr>
</listener>

Edit: added commit configuration

      <autoCommit> 
   <maxTime>120000</maxTime> 
   <openSearcher>true</openSearcher> 
 </autoCommit>
<autoSoftCommit> 
   <maxTime>${solr.autoSoftCommit.maxTime:-1}</maxTime> 
 </autoSoftCommit>

Solution

  • It turned out that this was not related to SolR at all but to internal routing. For those interested it turned out that ipv6 DNS was checked and needed to timeout before the IPv4 address was used, so the delay was from a DNS lookup+timeout and NOT from SOLr.