|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mmbase.util.functions.FunctionProvider
org.mmbase.util.functions.DescribedFunctionProvider
org.mmbase.module.Module
org.mmbase.module.ReloadableModule
org.mmbase.module.lucene.Lucene
public class Lucene
This is the implementation of a 'Lucene' module. It's main job is to bootstrap mmbase lucene indexing, and provide some functions to give access to lucene functionality in an MMBase way.
| Nested Class Summary | |
|---|---|
class |
Lucene.Scheduler
Queue for index operations. |
| Field Summary | |
|---|---|
protected static Parameter<String> |
ANALYZER
|
protected Function<Lucene.Scheduler.Assignment> |
assignmentFunction
|
protected AssignmentEvents.Listener |
assignmentsListener
|
protected static Parameter |
CLASS
|
protected Function<Void> |
clearDirectory
|
protected static Parameter<Boolean> |
COPY
|
protected Function<Void> |
deleteIndexFunction
This function deletes an indexed entry from an index if the Parameter 'index' has value null, all indexes are iterated over, otherwise the right index is addressed. |
protected Function<String> |
descriptionFunction
This function returns the description as configured for a specific index and a specific locale. |
static String |
DTD_LUCENE
|
static String |
DTD_LUCENE_2_0
|
protected static Parameter<String> |
EXTRACONSTRAINTS
|
protected static Parameter<String> |
FIELDS
|
protected static Parameter<String> |
FILTER
|
protected Function<Void> |
fullIndexFunction
This function starts a full Index of Lucene. |
protected Function<Integer> |
fullIndexing
|
protected static Parameter<String> |
IDENTIFIER
|
protected IdEventListener |
idListener
|
protected static Parameter<String> |
INDEX
|
protected Function<Set<Indexer>> |
indexerListFunction
This function returns Set with the names of all configured indexes (ordered alphabeticly) |
protected Function<String> |
interruptFunction
|
protected Function<Long> |
lastFullIndexDurationFunction
|
protected Function<Date> |
lastFullIndexFunction
|
protected Function<Set<String>> |
listFunction
This function returns Set with the names of all configured indexes (ordered alphabeticly) |
protected static Parameter |
MACHINES
|
protected static Parameter<Integer> |
MAX
|
protected MMBase |
mmbase
|
static String |
NAMESPACE_LUCENE
Most recend namespace |
static String |
NAMESPACE_LUCENE_1_0
|
protected static Parameter<Integer> |
OFFSET
|
protected static Parameter<String> |
ONFAIL
|
static String |
PUBLIC_ID_LUCENE
Most recent Lucene config DTD |
static String |
PUBLIC_ID_LUCENE_2_0
|
protected Function<Collection<Lucene.Scheduler.Assignment>> |
queueFunction
|
protected Function<Boolean> |
readOnlyFunction
|
protected Function<NodeList> |
searchFunction
This function starts a search fro a given string. |
protected Function<Integer> |
searchSizeFunction
This function returns the size of a query on an index. |
protected static Parameter<String> |
SORTFIELDS
|
protected Function<String> |
statusDescriptionFunction
|
protected Function<Integer> |
statusFunction
This function returns the status of the scheduler. |
protected Function<Integer> |
unAssignFunction
|
protected Function<Void> |
updateIndexFunction
This function can be called through the function framework. |
protected static Parameter<String> |
VALUE
Parameter constants for Lucene functions. |
protected Function<Void> |
waitFunction
|
static String |
XSD_LUCENE_1_0
But we use XSD now! |
| Fields inherited from class org.mmbase.module.Module |
|---|
configurationPath, getMaintainerFunction, getVersionFunction, properties, STATE_START_TIME |
| Fields inherited from class org.mmbase.util.functions.DescribedFunctionProvider |
|---|
description, guiName, name |
| Fields inherited from class org.mmbase.util.functions.FunctionProvider |
|---|
functions, getFunctions |
| Constructor Summary | |
|---|---|
Lucene()
|
|
| Method Summary | |
|---|---|
(package private) MMBaseIndexDefinition |
createIndexDefinition(Element queryElement,
Set<String> allIndexedFieldsSet,
boolean storeText,
boolean mergeText,
String relateFrom,
Analyzer analyzer)
MMBase Queries and sub-queries |
static String |
getAttribute(Element element,
String localName)
Returns the value of a certain attribute, either an unqualified attribute or an attribute that fits in the lucene namespace |
protected Cloud |
getCloud()
|
String |
getDescription()
Returns the description of this object for the default locale. |
static Lucene |
getLucene()
|
Searcher |
getSearcher(String indexName)
|
static boolean |
hasAttribute(Element element,
String localName)
Returns whether an element has a certain attribute, either an unqualified attribute or an attribute that fits in the lucene namespace |
void |
init()
Initializes the module. |
void |
init(boolean initialWait)
|
static void |
main(String[] args)
Main for testing |
void |
notify(AssignmentEvents.Event event)
|
void |
notify(IdEvent event)
|
void |
notify(NodeEvent event)
|
void |
notify(RelationEvent event)
|
void |
notify(SystemEvent systemEvent)
|
protected void |
readConfiguration(String resource)
|
void |
reload()
This method should be called when the module should be reloaded. |
void |
shutdown()
Shuts down the module. |
| Methods inherited from class org.mmbase.module.ReloadableModule |
|---|
reloadConfiguration, reloadConfiguration |
| Methods inherited from class org.mmbase.module.Module |
|---|
addInitParameters, checkModules, getInitParameter, getInitParameter, getInitParameter, getInitParameters, getInitParameters, getMaintainer, getModule, getModule, getModule, getModule, getModuleInfo, getModuleLoader, getModuleReader, getModuleReader, getModules, getState, getStates, getVersion, hasModule, hasStarted, loadInitParameters, loadInitParameters, maintainance, onload, setInitParameter, setMaintainer, setState, setVersion, shutdownModules, startModule, startModules |
| Methods inherited from class org.mmbase.util.functions.DescribedFunctionProvider |
|---|
getDefaultLocale, getDescription, getGUIName, getGUIName, getLocalizedDescription, getLocalizedGUIName, getName, setDescription, setDescription, setGUIName, setGUIName, setLocalizedDescription, setLocalizedGUIName, setName |
| Methods inherited from class org.mmbase.util.functions.FunctionProvider |
|---|
addFunction, createParameters, getFunction, getFunctions, getFunctionValue, newFunctionInstance |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String PUBLIC_ID_LUCENE_2_0
public static final String DTD_LUCENE_2_0
public static final String PUBLIC_ID_LUCENE
public static final String DTD_LUCENE
public static final String XSD_LUCENE_1_0
public static final String NAMESPACE_LUCENE_1_0
public static final String NAMESPACE_LUCENE
protected MMBase mmbase
protected static final Parameter<String> VALUE
protected static final Parameter<String> INDEX
protected static final Parameter MACHINES
protected static final Parameter<Boolean> COPY
protected static final Parameter CLASS
protected static final Parameter<String> SORTFIELDS
protected static final Parameter<String> FIELDS
protected static final Parameter<String> ANALYZER
protected static final Parameter<Integer> OFFSET
protected static final Parameter<Integer> MAX
protected static final Parameter<String> EXTRACONSTRAINTS
protected static final Parameter<String> FILTER
protected static final Parameter<String> ONFAIL
protected static final Parameter<String> IDENTIFIER
protected final Function<Void> fullIndexFunction
protected Function<Void> deleteIndexFunction
protected Function<Void> updateIndexFunction
protected Function<Integer> statusFunction
protected Function<String> statusDescriptionFunction
protected Function<Lucene.Scheduler.Assignment> assignmentFunction
protected Function<Collection<Lucene.Scheduler.Assignment>> queueFunction
protected Function<Void> waitFunction
protected Function<Boolean> readOnlyFunction
protected Function<Set<String>> listFunction
protected Function<Set<Indexer>> indexerListFunction
protected Function<String> descriptionFunction
protected Function<NodeList> searchFunction
protected Function<Integer> searchSizeFunction
protected Function<Void> clearDirectory
protected Function<Integer> fullIndexing
protected Function<Integer> unAssignFunction
protected Function<String> interruptFunction
protected Function<Date> lastFullIndexFunction
protected Function<Long> lastFullIndexDurationFunction
protected final IdEventListener idListener
protected final AssignmentEvents.Listener assignmentsListener
| Constructor Detail |
|---|
public Lucene()
| Method Detail |
|---|
public static Lucene getLucene()
public static boolean hasAttribute(Element element,
String localName)
public static String getAttribute(Element element,
String localName)
public void notify(AssignmentEvents.Event event)
notify in interface AssignmentEvents.Listenerpublic void init()
ModuleModule.startModule(), which makes sure it is not called
more than once. You should not call init() directly, call startModule() instead.
init in class Modulepublic void init(boolean initialWait)
public void notify(SystemEvent systemEvent)
notify in interface SystemEventListenerprotected Cloud getCloud()
public void shutdown()
Module
shutdown in class Modulepublic void reload()
ReloadableModule
reload in class ReloadableModulepublic String getDescription()
Descriptor
getDescription in interface DescriptorgetDescription in class DescribedFunctionProvider
MMBaseIndexDefinition createIndexDefinition(Element queryElement,
Set<String> allIndexedFieldsSet,
boolean storeText,
boolean mergeText,
String relateFrom,
Analyzer analyzer)
protected void readConfiguration(String resource)
public Searcher getSearcher(String indexName)
public void notify(NodeEvent event)
notify in interface NodeEventListenerpublic void notify(RelationEvent event)
notify in interface RelationEventListenerpublic void notify(IdEvent event)
notify in interface IdEventListenerpublic static void main(String[] args)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||