Package de.cxp.ocs.elasticsearch
Class ElasticsearchIndexer
java.lang.Object
de.cxp.ocs.indexer.AbstractIndexer
de.cxp.ocs.elasticsearch.ElasticsearchIndexer
- All Implemented Interfaces:
FullIndexationService,UpdateIndexService
-
Nested Class Summary
Nested classes/interfaces inherited from interface de.cxp.ocs.api.indexer.UpdateIndexService
UpdateIndexService.Result -
Constructor Summary
ConstructorsConstructorDescriptionElasticsearchIndexer(IndexSettings settings, FieldConfigIndex fieldConfAccess, org.elasticsearch.client.RestHighLevelClient restClient, List<DocumentPreProcessor> preProcessors, List<DocumentPostProcessor> postProcessors) -
Method Summary
Modifier and TypeMethodDescriptionprotected Documentprotected UpdateIndexService.Result_patch(String index, IndexableItem doc) protected UpdateIndexService.Result_put(String indexName, Boolean replaceExisting, IndexableItem doc) protected intaddToIndex(ImportSession session, List<IndexableItem> bulk) protected voidcleanupAbandonedImports(String indexName, int minAgeSeconds) deleteDocuments(String indexName, List<String> ids) Delete existing document.protected voiddeleteIndex(String indexName) booleandeploy(ImportSession session) booleanindexExists(String indexName) protected StringinitNewIndex(String indexName, String locale) checks to which actual index this "nice indexName (alias)" points to.booleanisImportRunning(String indexName) Checks if an active import session exists for that index.protected voidvalidateSession(ImportSession session) Methods inherited from class de.cxp.ocs.indexer.AbstractIndexer
add, cancel, done, patchDocument, patchDocuments, putDocument, putDocuments, putDocuments, startImport
-
Constructor Details
-
ElasticsearchIndexer
public ElasticsearchIndexer(IndexSettings settings, FieldConfigIndex fieldConfAccess, org.elasticsearch.client.RestHighLevelClient restClient, List<DocumentPreProcessor> preProcessors, List<DocumentPostProcessor> postProcessors)
-
-
Method Details
-
indexExists
- Specified by:
indexExistsin classAbstractIndexer
-
isImportRunning
Description copied from class:AbstractIndexerChecks if an active import session exists for that index.
This could either be the full internal or the minimal/final index name.
- Specified by:
isImportRunningin classAbstractIndexer- Parameters:
indexName- internal or external index name- Returns:
-
initNewIndex
checks to which actual index this "nice indexName (alias)" points to. Expects a indexName ending with a number and will return a new index name- Specified by:
initNewIndexin classAbstractIndexer- Throws:
IOException
-
validateSession
- Specified by:
validateSessionin classAbstractIndexer- Throws:
IllegalArgumentException
-
addToIndex
- Specified by:
addToIndexin classAbstractIndexer- Throws:
Exception
-
deploy
- Specified by:
deployin classAbstractIndexer
-
deleteIndex
- Specified by:
deleteIndexin classAbstractIndexer
-
_patch
- Specified by:
_patchin classAbstractIndexer
-
_put
protected UpdateIndexService.Result _put(String indexName, Boolean replaceExisting, IndexableItem doc) - Specified by:
_putin classAbstractIndexer
-
deleteDocuments
Description copied from interface:UpdateIndexServiceDelete existing document. If document does not exist, it returns code 404.- Parameters:
indexName- name of the index that should receive that updateids- Array of IDs of the documents that should be deleted- Returns:
- Result code, one of DELETED, NOT_FOUND
-
_get
- Specified by:
_getin classAbstractIndexer
-
cleanupAbandonedImports
- Specified by:
cleanupAbandonedImportsin classAbstractIndexer
-