DATAES-782 - Make underlying TransportClient accessible.
Original PR: #421
This commit is contained in:
committed by
GitHub
parent
e449944e3b
commit
3afd6fd427
@@ -343,5 +343,9 @@ public class ElasticsearchTemplate extends AbstractElasticsearchTemplate {
|
||||
} catch (Exception ignored) {}
|
||||
return null;
|
||||
}
|
||||
|
||||
public Client getClient() {
|
||||
return client;
|
||||
}
|
||||
// endregion
|
||||
}
|
||||
|
||||
+7
@@ -131,6 +131,13 @@ public class ElasticsearchTransportTemplateTests extends ElasticsearchTemplateTe
|
||||
assertThat(fetchSourceContext.excludes()).containsExactlyInAnyOrder("excl");
|
||||
}
|
||||
|
||||
@Test // DATAES-782
|
||||
void shouldProvideClient() {
|
||||
Client client = ((ElasticsearchTemplate) operations).getClient();
|
||||
|
||||
assertThat(client).isNotNull();
|
||||
}
|
||||
|
||||
@Data
|
||||
@Document(indexName = "test-index-sample-core-transport-template", replicas = 0, refreshInterval = "-1")
|
||||
static class SampleEntity {
|
||||
|
||||
Reference in New Issue
Block a user