railo.runtime.search
Interface SearchEngine


public interface SearchEngine

interface for a Search Engine


Field Summary
static boolean ALLOW_OVERWRITE
          overwrite allowed
static boolean DENY_OVERWRITE
          overwrite denied
 
Method Summary
 SearchCollection createCollection(java.lang.String name, Resource path, java.lang.String language, boolean allowOverwrite)
          Creates a new Collection and Store it (creating always a spellindex)
 SearchCollection getCollectionByName(java.lang.String name)
          returns a collection by name
 Query getCollectionsAsQuery()
           
 Resource getDirectory()
           
 java.lang.String getDisplayName()
           
 org.w3c.dom.Element getIndexElement(org.w3c.dom.Element collElement, java.lang.String id)
          return XML Element Matching index id
 LogAndSource getLogger()
           
 void init(Config config, Resource searchDir, LogAndSource log)
          constructor of the class
 

Field Detail

ALLOW_OVERWRITE

public static final boolean ALLOW_OVERWRITE
overwrite allowed

See Also:
Constant Field Values

DENY_OVERWRITE

public static final boolean DENY_OVERWRITE
overwrite denied

See Also:
Constant Field Values
Method Detail

init

public void init(Config config,
                 Resource searchDir,
                 LogAndSource log)
          throws org.xml.sax.SAXException,
                 java.io.IOException,
                 SearchException
constructor of the class

Parameters:
config -
searchDir - directory where the railo xml file is
log -
Throws:
java.io.IOException
org.xml.sax.SAXException
SearchException

getCollectionByName

public SearchCollection getCollectionByName(java.lang.String name)
                                     throws SearchException
returns a collection by name

Parameters:
name - name of the desired collection (case insensitive)
Returns:
returns lucene collection object matching name
Throws:
SearchException - if no matching Collection exist

getCollectionsAsQuery

public Query getCollectionsAsQuery()
Returns:
returns all collections as a query object

createCollection

public SearchCollection createCollection(java.lang.String name,
                                         Resource path,
                                         java.lang.String language,
                                         boolean allowOverwrite)
                                  throws SearchException
Creates a new Collection and Store it (creating always a spellindex)

Parameters:
name - The Name of the Collection
path - the path to store
language - The language of the collection
allowOverwrite -
Returns:
New SearchCollection
Throws:
SearchException

getDirectory

public Resource getDirectory()
Returns:
returns the directory of the search storage

getLogger

public LogAndSource getLogger()
Returns:
returns the logfile of the search storage

getIndexElement

public org.w3c.dom.Element getIndexElement(org.w3c.dom.Element collElement,
                                           java.lang.String id)
return XML Element Matching index id

Parameters:
collElement - XML Collection Element
id -
Returns:
XML Element

getDisplayName

public java.lang.String getDisplayName()
Returns:
returns the Name of the search engine to display in admin