Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ public class ElasticConfig {
@Value("${elasticsearch.authorization.password}")
private String password;

@Value("${elasticsearch.http.protocol:http}")
private String protocol;


private ElasticsearchClient client;
private static final AtomicBoolean esInitialized = new AtomicBoolean();
Expand All @@ -112,7 +115,7 @@ public class ElasticConfig {
public ElasticsearchClient getClient() {
if (client == null) {
// Create the low-level client
RestClientBuilder clientBuilder = RestClient.builder(new HttpHost(host, port));
RestClientBuilder clientBuilder = RestClient.builder(new HttpHost(host, port, protocol));

// Configure authentication
if (!authorizationHeader.isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ server.port=8080
# Elasticsearch connection parameters
elasticsearch.network.host=localhost
elasticsearch.http.port=9200
elasticsearch.http.protocol=http

# The value for the `Authorization` header used in requests to the Elasticsearch server.
# This header supports token-based or API key-based authentication.
Expand Down