Package org.nuxeo.elasticsearch.core
Class ElasticSearchIndexingImpl
- java.lang.Object
-
- org.nuxeo.elasticsearch.core.ElasticSearchIndexingImpl
-
- All Implemented Interfaces:
ElasticSearchIndexing
public class ElasticSearchIndexingImpl extends Object implements ElasticSearchIndexing
- Since:
- 6.0
-
-
Field Summary
Fields Modifier and Type Field Description protected static com.fasterxml.jackson.core.JsonFactoryJSON_FACTORY
-
Constructor Summary
Constructors Constructor Description ElasticSearchIndexingImpl(ElasticSearchAdminImpl esa)ElasticSearchIndexingImpl(ElasticSearchAdminImpl esa, JsonESDocumentWriter jsonESDocumentWriter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringgetPathOfDocFromEs(String repository, String indexName, String docId)Returns the ecm:path of an ES document or null if not found.protected StringgetSecondaryWriteIndexForRepository(String repository)protected StringgetWriteIndexForRepository(String repository)voidindexNonRecursive(List<IndexingCommand> cmds)Same asElasticSearchIndexing.indexNonRecursive(org.nuxeo.elasticsearch.commands.IndexingCommand)but process the list command using a bulk request.voidindexNonRecursive(IndexingCommand cmd)Process theIndexingCommand.protected voidprocessIndexRequest(String documentId, org.elasticsearch.action.index.IndexRequest request)voidreindexRepository(String repositoryName)Recreate an index and run an async reindexing worker.voidrunIndexingWorker(List<IndexingCommand> cmds)Run a worker to process theIndexingCommand.voidrunReindexingWorker(String repositoryName, String nxql, boolean syncAlias)Reindex documents matching the NXQL query, This is done in an asynchronous job.org.elasticsearch.common.bytes.BytesReferencesource(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
-
-
-
-
Constructor Detail
-
ElasticSearchIndexingImpl
public ElasticSearchIndexingImpl(ElasticSearchAdminImpl esa)
-
ElasticSearchIndexingImpl
public ElasticSearchIndexingImpl(ElasticSearchAdminImpl esa, JsonESDocumentWriter jsonESDocumentWriter)
- Since:
- 7.2
-
-
Method Detail
-
runIndexingWorker
public void runIndexingWorker(List<IndexingCommand> cmds)
Description copied from interface:ElasticSearchIndexingRun 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:
runIndexingWorkerin interfaceElasticSearchIndexing
-
runReindexingWorker
public void runReindexingWorker(String repositoryName, String nxql, boolean syncAlias)
Description copied from interface:ElasticSearchIndexingReindex 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:
runReindexingWorkerin interfaceElasticSearchIndexing
-
reindexRepository
public void reindexRepository(String repositoryName)
Description copied from interface:ElasticSearchIndexingRecreate an index and run an async reindexing worker.- Specified by:
reindexRepositoryin interfaceElasticSearchIndexing
-
indexNonRecursive
public void indexNonRecursive(List<IndexingCommand> cmds)
Description copied from interface:ElasticSearchIndexingSame asElasticSearchIndexing.indexNonRecursive(org.nuxeo.elasticsearch.commands.IndexingCommand)but process the list command using a bulk request.- Specified by:
indexNonRecursivein interfaceElasticSearchIndexing
-
indexNonRecursive
public void indexNonRecursive(IndexingCommand cmd)
Description copied from interface:ElasticSearchIndexingProcess 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:
indexNonRecursivein interfaceElasticSearchIndexing
-
processIndexRequest
protected void processIndexRequest(String documentId, org.elasticsearch.action.index.IndexRequest request)
-
getPathOfDocFromEs
protected String getPathOfDocFromEs(String repository, String indexName, String docId)
Returns the ecm:path of an ES document or null if not found.- Since:
- 2021.12
-
getSecondaryWriteIndexForRepository
protected String getSecondaryWriteIndexForRepository(String repository)
-
source
public org.elasticsearch.common.bytes.BytesReference source(DocumentModel doc) throws IOException
Description copied from interface:ElasticSearchIndexingReturns the JSON Elasticsearch source representation of a document.- Specified by:
sourcein interfaceElasticSearchIndexing- Throws:
IOException
-
-