I want to access a remote elasticsearch that is protected by a username and password. https: // [username]: [password] @ aws-eu-west-1-portal1.dblayer.com: 11109 /
In Spring, using an XML configuration, I was able to access my local elastic move, as shown below
<elasticsearch:repositories base-package="be.smartsearch.service.repository.elasticsearch" />
<elasticsearch:transport-client id="esClient" cluster-nodes="localhost:9300" />
<bean id="elasticsearchTemplate" class="org.springframework.data.elasticsearch.core.ElasticsearchTemplate">
<constructor-arg name="client" ref="esClient" />
</bean>
The only useful documentation I've found so far for PHP is: https://www.elastic.co/guide/en/elasticsearch/client/php-api/current/_security.html
How can I connect to remote elasticsearh with credentials in Spring data with XML configuration?
UPDATE 1
In Mongo, I was able to do this using the following method
<mongo:mongo host="${mongo.host}" port="${mongo.port}"/>
<mongo:db-factory dbname="SmartSearchAfterDemo" mongo-ref="mongo" username="${mongo.user}" password="${mongo.password}"/>
<bean id="mongoTemplate" class="org.springframework.data.mongodb.core.MongoTemplate">
<constructor-arg name="mongoDbFactory" ref="mongoDbFactory"/>
</bean>
<mongo:repositories base-package="be.smartsearch.service.repository.mongo"/>