1
0
mirror of synced 2025-12-25 02:09:19 -05:00

[destination-elasticsearch] Adding path prefix to connector's host (#58586)

Co-authored-by: Marcos Marx <marcosmarxm@users.noreply.github.com>
Co-authored-by: Octavia Squidington III <octavia-squidington-iii@users.noreply.github.com>
Co-authored-by: Edward Gao <edward.gao@airbyte.io>
This commit is contained in:
Farhan Khan
2025-06-05 21:11:00 +05:30
committed by GitHub
parent 1f2cabe30c
commit d1be55fe14
7 changed files with 26 additions and 9 deletions

View File

@@ -4,7 +4,7 @@ data:
connectorSubtype: api
connectorType: destination
definitionId: 68f351a7-2745-4bef-ad7f-996b8e51bb8c
dockerImageTag: 0.1.6
dockerImageTag: 0.2.0
dockerRepository: airbyte/destination-elasticsearch
githubIssueLabel: destination-elasticsearch
icon: elasticsearch.svg

View File

@@ -19,6 +19,7 @@ public class ConnectorConfiguration {
private boolean upsert;
@JsonProperty("ca_certificate")
private String caCertificate;
private String pathPrefix;
private AuthenticationMethod authenticationMethod = new AuthenticationMethod();
public static ConnectorConfiguration fromJsonNode(JsonNode config) {

View File

@@ -58,7 +58,12 @@ public class ElasticsearchConnection {
// Create the low-level client
httpHost = HttpHost.create(config.getEndpoint());
final RestClientBuilder builder = RestClient.builder(httpHost);
final RestClientBuilder builder;
if (config.getPathPrefix() != null) {
builder = RestClient.builder(httpHost).setPathPrefix(config.getPathPrefix());
} else {
builder = RestClient.builder(httpHost);
}
// Set custom user's certificate if provided
if (config.getCaCertificate() != null && !config.getCaCertificate().isEmpty()) {

View File

@@ -17,6 +17,11 @@
"type": "string",
"description": "The full url of the Elasticsearch server"
},
"pathPrefix": {
"title": "Server path prefix",
"type": "string",
"description": "The Path Prefix of the Elasticsearch server"
},
"upsert": {
"type": "boolean",
"title": "Upsert Records",