org.ceryle.xnode.search
Class XNodeFinder

java.lang.Object
  extended by org.ceryle.util.search.Finder
      extended by org.ceryle.xnode.search.XNodeFinder

public class XNodeFinder
extends Finder

Implements the Finder interface, providing a Lucene-based search engine designed for an XNodeStore.

Since:
JDK1.4
Version:
$Id: XNodeFinder.java,v 1.12 2007-06-15 12:10:33 altheim Exp $
Author:
Murray Altheim

Nested Class Summary
protected  class XNodeFinder.CacheProcessor
          Extends TimerTask, creating a low-priority process that sequentially flushes the XNodeStoreChangeCache of Collection change entries, deleting each cache entry as the search index is updated accordingly.
 
Field Summary
protected static boolean cacheActive
           
static long flush_period
          The period in milliseconds between cache flush events.
protected  Timer m_flush_timer
           
protected  org.apache.lucene.queryParser.QueryParser m_qp
           
protected  Services srvs
           
protected  XNodeStore xns
           
 
Fields inherited from class org.ceryle.util.search.Finder
m_indexer, mh, mw, progress
 
Constructor Summary
XNodeFinder(XNodeIndexer indexer, MessageHandler msghandler, MessageWriter msgwriter, ProgressBar progressBar)
          Constructor for an implementation of an XNodeFinder.
 
Method Summary
protected  void clearIndexDirectory()
          Clear the current index directory.
 org.apache.lucene.queryParser.QueryParser getQueryParser()
          Returns the QueryParser used by this Finder.
 SearchHit[] search(String queryString)
          Search the indexed directories for the provided search string, returning an array of SearchHit objects (empty, not null, if there is no match).
 void setChangeCacheFlushing(boolean active)
          When true, sets up the timer to periodically flush the database change cache.
 
Methods inherited from class org.ceryle.util.search.Finder
getIndexer, getProgressBar, hasProgressBar, setProgressBar
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

flush_period

public static long flush_period
The period in milliseconds between cache flush events. The default is 10000 (10 seconds).


m_qp

protected org.apache.lucene.queryParser.QueryParser m_qp

cacheActive

protected static boolean cacheActive

m_flush_timer

protected Timer m_flush_timer

xns

protected XNodeStore xns

srvs

protected Services srvs
Constructor Detail

XNodeFinder

public XNodeFinder(XNodeIndexer indexer,
                   MessageHandler msghandler,
                   MessageWriter msgwriter,
                   ProgressBar progressBar)
Constructor for an implementation of an XNodeFinder.

Parameters:
indexer - containing the search domains.
msghandler - to process status and other messages.
msgwriter - to receive status and other messages.
progressBar - (optional) to track search status.
Method Detail

search

public SearchHit[] search(String queryString)
Search the indexed directories for the provided search string, returning an array of SearchHit objects (empty, not null, if there is no match).

Specified by:
search in class Finder
Parameters:
queryString - the query string used for the search.
Returns:
an array of SearchHits corresponding to the matching Documents.

getQueryParser

public final org.apache.lucene.queryParser.QueryParser getQueryParser()
Returns the QueryParser used by this Finder.


clearIndexDirectory

protected void clearIndexDirectory()
Clear the current index directory. If it does not exist, nothing happens.


setChangeCacheFlushing

public void setChangeCacheFlushing(boolean active)
When true, sets up the timer to periodically flush the database change cache. When false, signals the timer thread to end.



The Ceryle Project. Copyright ©2001-2007 Murray Altheim, All Rights Reserved. See LICENSE included with distribution.