Package org.nuxeo.elasticsearch.core
Class ElasticSearchIndexingImpl
java.lang.Object
org.nuxeo.elasticsearch.core.ElasticSearchIndexingImpl
- All Implemented Interfaces:
ElasticSearchIndexing
- Since:
- 6.0
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final com.fasterxml.jackson.core.JsonFactory
-
Constructor Summary
ConstructorDescriptionElasticSearchIndexingImpl
(ElasticSearchAdminImpl esa, JsonESDocumentWriter jsonESDocumentWriter) -
Method Summary
Modifier and TypeMethodDescriptionprotected String
getPathOfDocFromEs
(String repository, String indexName, String docId) Returns the ecm:path of an ES document or null if not found.protected String
getSecondaryWriteIndexForRepository
(String repository) protected String
getWriteIndexForRepository
(String repository) void
indexNonRecursive
(List<IndexingCommand> cmds) Same asElasticSearchIndexing.indexNonRecursive(org.nuxeo.elasticsearch.commands.IndexingCommand)
but process the list command using a bulk request.void
Process theIndexingCommand
.protected void
processIndexRequest
(String documentId, org.opensearch.action.index.IndexRequest request) void
reindexRepository
(String repositoryName) Recreate an index and run an async reindexing worker.void
runIndexingWorker
(List<IndexingCommand> cmds) Run a worker to process theIndexingCommand
.void
runReindexingWorker
(String repositoryName, String nxql, boolean syncAlias) Reindex documents matching the NXQL query, This is done in an asynchronous job.org.opensearch.common.bytes.BytesReference
source
(DocumentModel doc) Returns the JSON Elasticsearch source representation of a document.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.nuxeo.elasticsearch.api.ElasticSearchIndexing
runReindexingWorker
-
Field Details
-
JSON_FACTORY
protected static final com.fasterxml.jackson.core.JsonFactory JSON_FACTORY
-
-
Constructor Details
-
ElasticSearchIndexingImpl
-
ElasticSearchIndexingImpl
public ElasticSearchIndexingImpl(ElasticSearchAdminImpl esa, JsonESDocumentWriter jsonESDocumentWriter) - Since:
- 7.2
-
-
Method Details
-
runIndexingWorker
Description copied from interface:ElasticSearchIndexing
Run a worker to process theIndexingCommand
.Asynchronous command schedules an indexing job and return.
Synchronous command execute an indexing job using a new Tx then refresh the index so the document is searchable immediately. if the command is also recursive the children are processed asynchronously.
If there is more than one cmd the elasticsearch request is done in bulk mode.
- Specified by:
runIndexingWorker
in interfaceElasticSearchIndexing
-
runReindexingWorker
Description copied from interface:ElasticSearchIndexing
Reindex documents matching the NXQL query, This is done in an asynchronous job. When syncAlias is true a call is made to sync the search alias with write alias once indexing is done.- Specified by:
runReindexingWorker
in interfaceElasticSearchIndexing
-
reindexRepository
Description copied from interface:ElasticSearchIndexing
Recreate an index and run an async reindexing worker.- Specified by:
reindexRepository
in interfaceElasticSearchIndexing
-
indexNonRecursive
Description copied from interface:ElasticSearchIndexing
Same asElasticSearchIndexing.indexNonRecursive(org.nuxeo.elasticsearch.commands.IndexingCommand)
but process the list command using a bulk request.- Specified by:
indexNonRecursive
in interfaceElasticSearchIndexing
-
indexNonRecursive
Description copied from interface:ElasticSearchIndexing
Process theIndexingCommand
.Send indexing command to Elasticsearch, if the command is synchronous the index is refreshed so the document is searchable immediately. Recursive indexing is not taken in account except for deletion. This is not a transactional operation, a rollback will not discard the executed commands.
- Specified by:
indexNonRecursive
in interfaceElasticSearchIndexing
-
processIndexRequest
protected void processIndexRequest(String documentId, org.opensearch.action.index.IndexRequest request) -
getPathOfDocFromEs
Returns the ecm:path of an ES document or null if not found.- Since:
- 2021.12
-
getWriteIndexForRepository
-
getSecondaryWriteIndexForRepository
-
source
Description copied from interface:ElasticSearchIndexing
Returns the JSON Elasticsearch source representation of a document.- Specified by:
source
in interfaceElasticSearchIndexing
- Throws:
IOException
-