org.mycore.services.fieldquery
Class MCRSearcherFactory
java.lang.Object
org.mycore.services.fieldquery.MCRSearcherFactory
public class MCRSearcherFactory
- extends Object
This class manages instances of MCRSearcher and provides methods to get these
for a given searcher ID. The class is responsible for looking up, loading,
instantiating and remembering the implementations of MCRSearcher used in the
system.
- Version:
- $Revision: 13085 $ $Date: 2008-02-06 18:27:24 +0100 (Mi, 06 Feb 2008) $
- Author:
- Frank Lützenkirchen
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
table
protected static Hashtable<String,MCRSearcher> table
- Hashtable SearcherID to MCRSearcher instance
MCRSearcherFactory
public MCRSearcherFactory()
getSearcher
public static MCRSearcher getSearcher(String searcherID)
- Returns the MCRSearcher instance that is configured for this SearcherID.
The instance that is returned is configured by the property
MCR.Searcher..Class in mycore.properties.
- Parameters:
searcherID - the non-null ID of the MCRSearcher implementation
- Returns:
- the MCRSearcher instance that uses this searcherID
- Throws:
MCRConfigurationException - if no MCRSearcher implementation is configured for this ID
getSearcherForIndex
public static MCRSearcher getSearcherForIndex(String indexID)
- Returns the MCRSearcher instance that manages the given index.
- Parameters:
indexID - the ID of the search index as declared in searchfields.xml
- Returns:
- the MCRSearcher instance that manages this index
- Throws:
MCRConfigurationException - if no MCRSearcher implementation is configured for this index