When creating a new Alfresco Repository you must use the Elasticsearch connector applications in the following sequence:
- Start the Content Services Stack, including the Elasticsearch connector live indexing services, and the Elasticsearch server.
- Configure the Elasticsearch connector re-indexing app to point to the database, the Elasticsearch server, and the ActiveMQ server.
- Run the re-indexing app from the command line. Replace the connection details as appropriate. Replace the x.x.x in the name of the .jar file with the appropriate version number.
$ java -jar alfresco-elasticsearch-reindexing-x.x.x-app.jar \ --alfresco.reindex.jobName=reindexByIds \ --spring.elasticsearch.rest.uris=http://localhost:9200 \ --spring.datasource.url=jdbc:postgresql://localhost:5432/alfresco \ --spring.datasource.username=alfresco \ --spring.datasource.password=alfresco \ --spring.activemq.broker-url=tcp://localhost:61616?jms.useAsyncSend=true \ --alfresco.reindex.prefixes-file=file:reindex.prefixes-file.json
When completed successfully you will see:
o.s.batch.core.step.AbstractStep : Step: [reindexByIdsStep] executed in 4s952ms o.a.r.w.ElasticsearchRepoEventItemWriter : Total indexed documents:: 845 o.a.r.listeners.JobLifecycleListener : Current Status: COMPLETED
Once the command has completed, metadata and permissions from the out-of-the-box repository nodes are indexed in the Elasticsearch server. Additionally, the Elasticsearch connector live indexer will add existing content, the new metadata, permissions, and new content when nodes are created, updated or deleted.