de.pangaea.metadataportal.search
Class LuceneCache

java.lang.Object
  extended by de.pangaea.metadataportal.search.LuceneCache

public final class LuceneCache
extends Object

Implementation of the caching algorithm behind the panFMP search engine. This class is for internal use only.

To configure the cache use the following search properties in your config file (these are the defaults):

<cacheMaxAge>300</cacheMaxAge>
<cacheMaxSessions>30</cacheMaxSessions>
<indexChangeCheckInterval>30</indexChangeCheckInterval>
<reloadIndexIfChangedAfter>60</reloadIndexIfChangedAfter>
<keepOldReaderAlive>60</keepOldReaderAlive>
<maxStoredQueries>200</maxStoredQueries>

Author:
Uwe Schindler

Nested Class Summary
protected static class LuceneCache.Session
          Implementation of a cache entry.
 
Field Summary
 Config config
           
static int DEFAULT_CACHE_MAX_AGE
           
static int DEFAULT_CACHE_MAX_SESSIONS
           
static int DEFAULT_FETCH_FACTOR
           
static int DEFAULT_INDEX_CHANGE_CHECK_INTERVAL
           
static int DEFAULT_KEEP_OLD_READER_ALIVE
           
static int DEFAULT_MAX_STORED_QUERIES
           
static int DEFAULT_RELOAD_AFTER
           
 IndexReaderWarmerImpl warmer
           
 
Method Summary
 org.apache.lucene.document.FieldSelector getFieldSelector(boolean loadXml, Collection<String> fieldsToLoad)
           
static LuceneCache getInstance(String cfgFile)
           
 LuceneCache.Session getSession(IndexConfig index, org.apache.lucene.search.Query query, org.apache.lucene.search.Sort sort)
           
 org.apache.lucene.search.Query readStoredQuery(UUID uuid)
           
 UUID storeQuery(org.apache.lucene.search.Query query)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

warmer

public final IndexReaderWarmerImpl warmer

config

public final Config config

DEFAULT_CACHE_MAX_AGE

public static final int DEFAULT_CACHE_MAX_AGE
See Also:
Constant Field Values

DEFAULT_INDEX_CHANGE_CHECK_INTERVAL

public static final int DEFAULT_INDEX_CHANGE_CHECK_INTERVAL
See Also:
Constant Field Values

DEFAULT_RELOAD_AFTER

public static final int DEFAULT_RELOAD_AFTER
See Also:
Constant Field Values

DEFAULT_KEEP_OLD_READER_ALIVE

public static final int DEFAULT_KEEP_OLD_READER_ALIVE
See Also:
Constant Field Values

DEFAULT_MAX_STORED_QUERIES

public static final int DEFAULT_MAX_STORED_QUERIES
See Also:
Constant Field Values

DEFAULT_CACHE_MAX_SESSIONS

public static final int DEFAULT_CACHE_MAX_SESSIONS
See Also:
Constant Field Values

DEFAULT_FETCH_FACTOR

public static final int DEFAULT_FETCH_FACTOR
See Also:
Constant Field Values
Method Detail

getInstance

public static LuceneCache getInstance(String cfgFile)
                               throws Exception
Throws:
Exception

storeQuery

public UUID storeQuery(org.apache.lucene.search.Query query)

readStoredQuery

public org.apache.lucene.search.Query readStoredQuery(UUID uuid)

getSession

public LuceneCache.Session getSession(IndexConfig index,
                                      org.apache.lucene.search.Query query,
                                      org.apache.lucene.search.Sort sort)
                               throws IOException
Throws:
IOException

getFieldSelector

public org.apache.lucene.document.FieldSelector getFieldSelector(boolean loadXml,
                                                                 Collection<String> fieldsToLoad)


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