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.JsonFactory
JSON_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 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
indexNonRecursive(IndexingCommand cmd)
Process theIndexingCommand
.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.elasticsearch.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 Detail
-
JSON_FACTORY
protected static final com.fasterxml.jackson.core.JsonFactory JSON_FACTORY
-
-
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: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
public void runReindexingWorker(String repositoryName, String nxql, boolean syncAlias)
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
public void reindexRepository(String repositoryName)
Description copied from interface:ElasticSearchIndexing
Recreate an index and run an async reindexing worker.- Specified by:
reindexRepository
in interfaceElasticSearchIndexing
-
indexNonRecursive
public void indexNonRecursive(List<IndexingCommand> cmds)
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
public void indexNonRecursive(IndexingCommand cmd)
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
-
getWriteIndexForRepository
protected String getWriteIndexForRepository(String repository)
-
source
public org.elasticsearch.common.bytes.BytesReference source(DocumentModel doc) throws IOException
Description copied from interface:ElasticSearchIndexing
Returns the JSON Elasticsearch source representation of a document.- Specified by:
source
in interfaceElasticSearchIndexing
- Throws:
IOException
-
-