You must first activate and configure the Search Services subsystem in Content Services by using either the TOMCAT_HOME>/shared/classes/alfresco-global.properties file or the Repository Admin Console.
Add the following lines to the configuration file alfresco-global.properties to enable the Elasticsearch Search subsystem.
# Set the Elasticsearch subsystem index.subsystem.name=elasticsearch # Elasticsearch index properties elasticsearch.indexName=alfresco elasticsearch.createIndexIfNotExists=true # Elasticsearch server properties elasticsearch.host=localhost elasticsearch.port=9200 elasticsearch.baseUrl=/
These configuration properties are used by Content Services to communicate with the Elasticsearch server. In the example above a plain HTTP connection is configured, but Alfresco Repository also supports communication with Elasticsearch server using Basic Authentication and the HTTPs protocol, for more see the Subsystem section in the Alfresco Search Services documentation.
If using the Repository Admin Web Console select Repository Services > Search Service and set the properties from that web page, see below.