public class LucenesearchManager extends GeneratedLucenesearchManager
Lucenesearch stores information in indexes. Indexes are updated and searched separately. This
allows to construct separate search spaces for frontend and backend searches.
For each index, a number of IndexConfigurations can be created. Each represents a type
whos instances are added to the index. The AttributeConfigurations belonging to the
IndexConfigurationdefine which fields of the type are indexed.
Additionally, IndexConfigurations can declare an activation attibute and a grouping attribute.
true.searching
the index, the result can be restricted to those items contained in certain groups. (Please note that the
default implementation does not support
multiple groups.)
For performance reasons, the search information is kept in a filesystem, not the database. The root directory where
lucenesearch stores information can be configured through the project.properties entry
lucenesearch.indexdir of the lucenesearch extension. Make
sure this points to a shared directory in a clustered environment.
If the possibilities offered by Index- and AttributeConfiguration are not sufficient, it is possible to replace the
IndexedDataFactory, see setIndexedDataFactoryClassName and IndexedDataFactory.
Context-specific visibility checks can be implemented using a PostQueryFilter.
Extension.RestrictedLanguagesProvider, Extension.RightsProviderManager.GenericManagerSingletonCreator, Manager.ManagerSingletonCreatorDEFAULT_INITIAL_ATTRIBUTES, INDEXTYPERELATION_MARKMODIFIED, INDEXTYPERELATION_SRC_ORDERED, INDEXTYPERELATION_TGT_ORDERED| Constructor and Description |
|---|
LucenesearchManager() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
abortAllUpdateCronjobs(boolean allNodes) |
protected void |
checkBeforeItemRemoval(SessionContext ctx,
Item item)
Superclass method overridden to avoid calls to ejb layer.
|
void |
createEssentialData(Map values,
JspContext jspc)
installs the lucenesearch's
RebuildIndexJob, and creates an LuceneIndex on product code and name if
LucenesearchConstants.CREATE_PARAMETER_PRODUCTINDEXis set to true |
void |
createHMCIndex(Map values,
JspContext jspc) |
void |
createHMCIndexOld(Map values,
JspContext jspc) |
LuceneIndex |
createLuceneIndex(String code)
Creates a new LuceneIndex with the given code, initially without any IndexConfigurations.
|
void |
createProjectData(Map params,
JspContext jspc) |
protected void |
createRebuildCronjob() |
protected void |
createUpdateCronjob() |
protected Set<ComposedType> |
getConcreteTypes(ComposedType indexedType,
Map<ComposedType,Map<AttributeDescriptor,String>> indexedAttributes) |
String |
getCreatorParameterDefault(String param)
Override this method to provide default value for the given creator parameter.
|
Collection |
getCreatorParameterNames()
Override this method to provide parameters for the system creator.
|
List |
getCreatorParameterPossibleValues(String param)
Override this method to provide a list of all possible values for the given creator parameter.
|
static LucenesearchManager |
getInstance() |
LuceneIndex |
getLuceneIndex(String code)
Gets the LuceneIndex with the given code.
|
Set<LuceneIndex> |
getLuceneIndexes()
Gets all LuceneIndexes.
|
protected int |
getMaxClusterID() |
CronJob |
getRebuildIndexCronJob()
Gets the CronJob that runs the
RebuildIndexJob. |
RebuildIndexJob |
getRebuildIndexJob()
Gets the single RebuildIndexJob instance.
|
UpdateIndexJob |
getUpdateIndexJob() |
void |
notifyInitializationEnd(Map params,
JspContext ctx) |
protected void |
notifyItemRemoval(SessionContext ctx,
Item item)
Superclass method overridden to avoid calls to ejb layer.
|
void |
rebuildAllIndexes()
calls
LuceneIndex.rebuildIndex()on all indexes |
protected boolean |
rebuildIndexesRequested(Map params) |
void |
updateAllIndexesForItem(Item item)
calls
LuceneIndex.updateIndexForItem(Item)on all indexes |
void |
updateAllIndexesForItem(Item item,
boolean remove) |
createAttributeConfiguration, createAttributeConfiguration, createIndexConfiguration, createIndexConfiguration, createIndexUpdate, createIndexUpdate, createLanguageConfiguration, createLanguageConfiguration, createLuceneIndex, createLuceneIndex, createRebuildIndexJob, createRebuildIndexJob, createUpdateIndexJob, createUpdateIndexJob, getDefaultAttributeModes, getHmcIndexField, getHmcIndexField, getName, isForceLuceneIndexable, isForceLuceneIndexable, isForceLuceneIndexableAsPrimitive, isForceLuceneIndexableAsPrimitive, setForceLuceneIndexable, setForceLuceneIndexable, setForceLuceneIndexable, setForceLuceneIndexable, setHmcIndexField, setHmcIndexFieldcreateSampleData, getCreatorDescription, getCreatorName, getRemote, isCreatorDisabled, notifyInitializationStart, onFirstSessionCreation, writeReplaceafterItemCreation, beforeItemCreation, destroy, getAllValuesSessionContext, getAttribute, getAttributeMap, getFirstItemByAttribute, getFirstItemByAttribute, getRemoteManagerClass, getSession, getSingletonManagerInstance, getTenant, getTransientObject, getTransientObjectMap, init, setAttribute, setTenant, setTransientObject, unwrap, unwrap, wrappublic static LucenesearchManager getInstance()
protected void checkBeforeItemRemoval(SessionContext ctx, Item item) throws ConsistencyCheckException
checkBeforeItemRemoval in class Extensionctx - the current session contextitem - the item which should be removedConsistencyCheckException - thrown to abort removal due to consistency errorsprotected void notifyItemRemoval(SessionContext ctx, Item item)
notifyItemRemoval in class Extensionctx - the currency session contextitem - the item which is going to be removedpublic LuceneIndex createLuceneIndex(String code)
public LuceneIndex getLuceneIndex(String code) throws JaloItemNotFoundException
JaloItemNotFoundException - if there is no such indexpublic Set<LuceneIndex> getLuceneIndexes()
LuceneIndexespublic void updateAllIndexesForItem(Item item)
LuceneIndex.updateIndexForItem(Item)on all indexespublic void updateAllIndexesForItem(Item item, boolean remove)
protected void abortAllUpdateCronjobs(boolean allNodes)
public void rebuildAllIndexes()
LuceneIndex.rebuildIndex()on all indexespublic RebuildIndexJob getRebuildIndexJob()
public UpdateIndexJob getUpdateIndexJob()
public CronJob getRebuildIndexCronJob()
RebuildIndexJob.JaloItemNotFoundException - if the RebuildIndex CronJob does not existpublic Collection getCreatorParameterNames()
ExtensiongetCreatorParameterNames in class Extensionpublic String getCreatorParameterDefault(String param)
ExtensiongetCreatorParameterDefault in class Extensionparam - the name of the parameternull when the parameter should have no
default valuepublic List getCreatorParameterPossibleValues(String param)
Extensionnull the list of these values will be shown to the user of system creator and no other values will be
possible to set.getCreatorParameterPossibleValues in class Extensionparam - the name of the parameternull when this parameter
should have no restriction of possible valuespublic void createEssentialData(Map values, JspContext jspc) throws Exception
RebuildIndexJob, and creates an LuceneIndex on product code and name if
LucenesearchConstants.CREATE_PARAMETER_PRODUCTINDEXis set to truecreateEssentialData in class ExtensionExceptionprotected boolean rebuildIndexesRequested(Map params)
public void notifyInitializationEnd(Map params, JspContext ctx) throws Exception
notifyInitializationEnd in class ExtensionExceptionprotected void createRebuildCronjob()
protected void createUpdateCronjob()
protected int getMaxClusterID()
public void createHMCIndexOld(Map values, JspContext jspc) throws Exception
Exceptionpublic void createHMCIndex(Map values, JspContext jspc) throws Exception
Exceptionprotected Set<ComposedType> getConcreteTypes(ComposedType indexedType, Map<ComposedType,Map<AttributeDescriptor,String>> indexedAttributes)
public void createProjectData(Map params, JspContext jspc)
createProjectData in class ExtensionCopyright © 2017 SAP SE. All Rights Reserved.