de.pangaea.metadataportal.search
Class IndexReaderWarmerImpl

java.lang.Object
  extended by org.apache.lucene.index.IndexWriter.IndexReaderWarmer
      extended by de.pangaea.metadataportal.search.IndexReaderWarmerImpl

public final class IndexReaderWarmerImpl
extends IndexWriter.IndexReaderWarmer

This class warms IndexReaders after reopens. It uses some default queries and sort options from the config file But SearchService can also add extra Query instances during operation which are maintained by usage count.

Author:
Uwe Schindler

Field Summary
static int DEFAULT_WARM_LIFE_QUERIES
           
 
Constructor Summary
IndexReaderWarmerImpl(Config config)
           
 
Method Summary
 void addFixedQuery(Query q, Sort s)
          This should only be called after ctor initialization to specify fixed queries to execute
 void addLifeQuery(Query q, Sort s)
          Registers a user-query in the LRU list.
protected  void runQuery(IndexSearcher searcher, de.pangaea.metadataportal.search.IndexReaderWarmerImpl.Entry e)
           
 void warm(IndexReader reader)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_WARM_LIFE_QUERIES

public static final int DEFAULT_WARM_LIFE_QUERIES
See Also:
Constant Field Values
Constructor Detail

IndexReaderWarmerImpl

public IndexReaderWarmerImpl(Config config)
Method Detail

addFixedQuery

public void addFixedQuery(Query q,
                          Sort s)
This should only be called after ctor initialization to specify fixed queries to execute


addLifeQuery

public void addLifeQuery(Query q,
                         Sort s)
Registers a user-query in the LRU list. If a warmup is currently running it does nothing for performance reasons


runQuery

protected void runQuery(IndexSearcher searcher,
                        de.pangaea.metadataportal.search.IndexReaderWarmerImpl.Entry e)
                 throws IOException
Throws:
IOException

warm

public void warm(IndexReader reader)
          throws IOException
Specified by:
warm in class IndexWriter.IndexReaderWarmer
Throws:
IOException


Copyright ©2007-2013 panFMP Developers c/o Uwe Schindler