com.toalango.qzarch
Class SearchEngine

java.lang.Object
  |
  +--com.toalango.qzarch.SearchEngine

public class SearchEngine
extends java.lang.Object

This search engine can either be set up in advance with all the configurations, or the execute metods can be called with the relevant configurations as arguments, thus overriding any defaults set already.

The features of this search engine include:

Author:
Rune Toalango Johannesen
See Also:
Resource

Constructor Summary
SearchEngine()
          An empty constructor for clients that want to configure the properties of the search engine themselves.
SearchEngine(com.toalango.qzarch.SearchEngineConfig pSearchEngineConfig)
          From the main servlet handling the searches you instantiate the SearchEngine in the overridden GenericServlet.init() method by passing SearchEngineConfig object to this constructor.
 
Method Summary
 com.toalango.qzarch.SearchEngineConfig getSearchEngineConfig()
           
 com.toalango.qzarch.Resource[] run(java.lang.String pSearchString)
          Apply all the default settings for the search engine and perform a search based on a particular search expression.
 com.toalango.qzarch.Resource[] run(java.lang.String[] pFileTypes, java.lang.String pSearchString, boolean pCaseSensitive)
          Method to call to perform a search based on particular file types, and a given setting for case sensitivity.
 com.toalango.qzarch.Resource[] run(java.lang.String[] pFileTypes, java.lang.String pKeywords, boolean pCaseSensitive, boolean pSupportingExpression)
          Method to call to provide the search engine with a full set of arguments to the search.
 com.toalango.qzarch.Resource[] run(java.lang.String pSearchString, boolean pCaseSensitive)
          Method to call to perform a search.
 void setSearchEngineConfig(com.toalango.qzarch.SearchEngineConfig pSearchEngineConfig)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SearchEngine

public SearchEngine()
An empty constructor for clients that want to configure the properties of the search engine themselves.


SearchEngine

public SearchEngine(com.toalango.qzarch.SearchEngineConfig pSearchEngineConfig)
From the main servlet handling the searches you instantiate the SearchEngine in the overridden GenericServlet.init() method by passing SearchEngineConfig object to this constructor.

The search engine will then, based on some optional Servlet init parameters, configure itself. If the configuration fails, a ServletException will be thrown with the cause of failure as message.

Parameters:
pSearchEngineConfig - The configuration of the search servlet
Method Detail

getSearchEngineConfig

public com.toalango.qzarch.SearchEngineConfig getSearchEngineConfig()

setSearchEngineConfig

public void setSearchEngineConfig(com.toalango.qzarch.SearchEngineConfig pSearchEngineConfig)

run

public com.toalango.qzarch.Resource[] run(java.lang.String pSearchString)
Apply all the default settings for the search engine and perform a search based on a particular search expression.

Parameters:
pSearchString - The search expression
Returns:
an array of matched resources

run

public com.toalango.qzarch.Resource[] run(java.lang.String pSearchString,
                                          boolean pCaseSensitive)
Method to call to perform a search.

Parameters:
pSearchString - The search expression
pCaseSensitive - Overrule the default setting of the case sensitive property with the value provided here
Returns:
an array of matched resources

run

public com.toalango.qzarch.Resource[] run(java.lang.String[] pFileTypes,
                                          java.lang.String pSearchString,
                                          boolean pCaseSensitive)
Method to call to perform a search based on particular file types, and a given setting for case sensitivity.

Parameters:
pFileTypes - The file types to look for
pSearchString - The search expression
pCaseSensitive - Not ignore lower and upper case
Returns:
an array of matched resources

run

public com.toalango.qzarch.Resource[] run(java.lang.String[] pFileTypes,
                                          java.lang.String pKeywords,
                                          boolean pCaseSensitive,
                                          boolean pSupportingExpression)
Method to call to provide the search engine with a full set of arguments to the search.

Parameters:
pFileTypes - The file types to look for
pKeywords - The search string
pCaseSensitive - false if case should be ignored, otherwise true
pSupportingExpression - true if the search keyword should be examined for simpel AND and OR expressions, otherwise false
Returns:
an array of matched resources