Class IndexationService
java.lang.Object
fr.paris.lutece.portal.service.search.IndexationService
This class provides management methods for indexing
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddIndexerAction(String strIdDocument, String indexerName, int nIdTask) Add Indexer Action to perform on a recordstatic voidaddIndexerAction(String strIdDocument, String indexerName, int nIdTask, int nIdPortlet) Add Indexer Action to perform on a recordstatic voiderror(IndexerAction action, Exception e, String strMessage) Log the error for the indexer action.static voiderror(SearchIndexer indexer, Exception e, String strMessage) Log the error for the search indexer.static List<IndexerAction>getAllIndexerActionByTask(int nIdTask) return a list of IndexerAction by task keystatic org.apache.lucene.analysis.AnalyzerGets the current analyserstatic org.apache.lucene.store.DirectoryGets the current IndexSearcher.static Collection<SearchIndexer>Returns all search indexersstatic voidinit()Initalizes the servicestatic StringprocessIndexing(boolean bCreate) Process the indexingstatic voidregisterIndexer(SearchIndexer indexer) Register an indexerstatic voidRemove all Indexer Actionstatic voidremoveIndexerAction(int nIdAction) Remove a Indexer Actionstatic voidunregisterIndexer(SearchIndexer indexer) Unregister an indexer.static voidwrite(org.apache.lucene.document.Document doc) Index one document, called by plugin indexers
-
Field Details
-
PATH_INDEX
- See Also:
-
PATH_INDEX_IN_WEBAPP
- See Also:
-
PARAM_FORCING
- See Also:
-
ALL_DOCUMENT
public static final int ALL_DOCUMENT- See Also:
-
LUCENE_INDEX_VERSION
public static final org.apache.lucene.util.Version LUCENE_INDEX_VERSION
-
-
Method Details
-
init
Initalizes the service- Throws:
LuteceInitException- If an error occured
-
registerIndexer
Register an indexer- Parameters:
indexer- The indexer to add to the registry
-
unregisterIndexer
Unregister an indexer. The indexer is only removed if its name has not changed- Parameters:
indexer- the indexer to remove from the registry
-
processIndexing
Process the indexing- Parameters:
bCreate- Force creating the index- Returns:
- the result log of the indexing
-
write
Index one document, called by plugin indexers- Parameters:
doc- the document to index- Throws:
org.apache.lucene.index.CorruptIndexException- corruptIndexExceptionIOException- i/o exception
-
error
Log the error for the search indexer.- Parameters:
indexer- theSearchIndexere- the exceptionstrMessage- the str message
-
error
Log the error for the indexer action.- Parameters:
action- theIndexerActione- the exceptionstrMessage- the str message
-
getDirectoryIndex
Gets the current IndexSearcher.- Returns:
- IndexSearcher
- Throws:
IOException- Signals that an I/O exception has occurred.
-
getAnalyser
public static org.apache.lucene.analysis.Analyzer getAnalyser()Gets the current analyser- Returns:
- The analyser
-
getIndexers
Returns all search indexers- Returns:
- A collection of indexers
-
getAllIndexerActionByTask
return a list of IndexerAction by task key- Parameters:
nIdTask- the task kety- Returns:
- a list of IndexerAction
-
removeIndexerAction
public static void removeIndexerAction(int nIdAction) Remove a Indexer Action- Parameters:
nIdAction- the key of the action to remove
-
removeAllIndexerAction
public static void removeAllIndexerAction()Remove all Indexer Action -
addIndexerAction
public static void addIndexerAction(String strIdDocument, String indexerName, int nIdTask, int nIdPortlet) Add Indexer Action to perform on a record- Parameters:
strIdDocument- the id of the documentindexerName- the name of the indexernIdTask- the key of the action to donIdPortlet- id of the portlet
-
addIndexerAction
Add Indexer Action to perform on a record- Parameters:
strIdDocument- the id of the documentindexerName- the name of the indexernIdTask- the key of the action to do
-