org.ceryle.util.search
Class FSFinder

java.lang.Object
  extended by org.ceryle.util.search.Finder
      extended by org.ceryle.util.search.FSFinder

public class FSFinder
extends Finder

Implements the Finder interface, providing a Lucene-based search engine designed to index a file system. The specific directory is set relative to a directory provided by a set property.

Since:
JDK1.4
Version:
$Id: FSFinder.java,v 1.10 2007-06-15 12:10:03 altheim Exp $
Author:
Murray Altheim

Field Summary
protected  org.apache.lucene.queryParser.QueryParser m_qp
           
 
Fields inherited from class org.ceryle.util.search.Finder
m_indexer, mh, mw, progress
 
Constructor Summary
FSFinder(FSIndexer indexer, MessageHandler msghandler, MessageWriter msgwriter, ProgressBar progressbar)
          Constructor for an implementation of an FSFinder.
FSFinder(Indexer indexer, MessageHandler msghandler, MessageWriter msgwriter, ProgressBar progressbar)
          Constructor for an implementation of an FSFinder.
 
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).
 
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

m_qp

protected org.apache.lucene.queryParser.QueryParser m_qp
Constructor Detail

FSFinder

public FSFinder(Indexer indexer,
                MessageHandler msghandler,
                MessageWriter msgwriter,
                ProgressBar progressbar)
Constructor for an implementation of an FSFinder.

Parameters:
indexer - provides the search index
msghandler - to process status and other messages.
msgwriter - to receive status and other messages.
progressbar - (optional) to track search status.

FSFinder

public FSFinder(FSIndexer indexer,
                MessageHandler msghandler,
                MessageWriter msgwriter,
                ProgressBar progressbar)
Constructor for an implementation of an FSFinder.

Parameters:
indexer - provides the search index
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.



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