public class DefaultReactiveElasticsearchClient extends Object implements ReactiveElasticsearchClient
WebClient based ReactiveElasticsearchClient that connects to an Elasticsearch cluster using HTTP.ClientConfiguration,
ReactiveRestClientsReactiveElasticsearchClient.ReactiveElasticsearchClientCallback, ReactiveElasticsearchClient.Status| Constructor and Description |
|---|
DefaultReactiveElasticsearchClient(HostProvider hostProvider)
Create a new
DefaultReactiveElasticsearchClient using the given HostProvider to obtain server
connections. |
| Modifier and Type | Method and Description |
|---|---|
static ReactiveElasticsearchClient |
create(ClientConfiguration clientConfiguration)
Create a new
DefaultReactiveElasticsearchClient given ClientConfiguration. |
static ReactiveElasticsearchClient |
create(HttpHeaders headers,
String... hosts)
Create a new
DefaultReactiveElasticsearchClient aware of the given nodes in the cluster. |
reactor.core.publisher.Mono<org.elasticsearch.action.delete.DeleteResponse> |
delete(HttpHeaders headers,
org.elasticsearch.action.delete.DeleteRequest deleteRequest)
Execute the given
DeleteRequest against the delete API to remove a document. |
reactor.core.publisher.Mono<org.elasticsearch.index.reindex.BulkByScrollResponse> |
deleteBy(HttpHeaders headers,
org.elasticsearch.index.reindex.DeleteByQueryRequest deleteRequest)
Execute a
DeleteByQueryRequest against the delete by query API. |
reactor.core.publisher.Mono<ClientResponse> |
execute(ReactiveElasticsearchClient.ReactiveElasticsearchClientCallback callback)
Compose the actual command/s to run against Elasticsearch using the underlying
connection. |
reactor.core.publisher.Mono<Boolean> |
exists(HttpHeaders headers,
org.elasticsearch.action.get.GetRequest getRequest)
Checks for the existence of a document.
|
reactor.core.publisher.Mono<org.elasticsearch.index.get.GetResult> |
get(HttpHeaders headers,
org.elasticsearch.action.get.GetRequest getRequest)
Execute the given
GetRequest against the get API to retrieve a document by id. |
reactor.core.publisher.Mono<org.elasticsearch.action.index.IndexResponse> |
index(HttpHeaders headers,
org.elasticsearch.action.index.IndexRequest indexRequest)
Execute the given
IndexRequest against the index API to index a document. |
reactor.core.publisher.Mono<org.elasticsearch.action.main.MainResponse> |
info(HttpHeaders headers)
Get the cluster info otherwise provided when sending an HTTP request to port 9200.
|
reactor.core.publisher.Flux<org.elasticsearch.index.get.GetResult> |
multiGet(HttpHeaders headers,
org.elasticsearch.action.get.MultiGetRequest multiGetRequest)
Execute the given
MultiGetRequest against the multi-get API to retrieve multiple documents by
id. |
reactor.core.publisher.Mono<Boolean> |
ping(HttpHeaders headers)
Pings the remote Elasticsearch cluster and emits true if the ping succeeded, false otherwise.
|
reactor.core.publisher.Flux<org.elasticsearch.search.SearchHit> |
scroll(HttpHeaders headers,
org.elasticsearch.action.search.SearchRequest searchRequest)
Execute the given
SearchRequest against the search scroll API. |
reactor.core.publisher.Flux<org.elasticsearch.search.SearchHit> |
search(HttpHeaders headers,
org.elasticsearch.action.search.SearchRequest searchRequest)
Execute the given
SearchRequest against the search API. |
reactor.core.publisher.Mono<ReactiveElasticsearchClient.Status> |
status()
Get the current client
ReactiveElasticsearchClient.Status. |
reactor.core.publisher.Mono<org.elasticsearch.action.update.UpdateResponse> |
update(HttpHeaders headers,
org.elasticsearch.action.update.UpdateRequest updateRequest)
Execute the given
UpdateRequest against the update API to alter a document. |
public DefaultReactiveElasticsearchClient(HostProvider hostProvider)
DefaultReactiveElasticsearchClient using the given HostProvider to obtain server
connections.hostProvider - must not be null.public static ReactiveElasticsearchClient create(HttpHeaders headers, String... hosts)
DefaultReactiveElasticsearchClient aware of the given nodes in the cluster. HttpHeaders
correctly.headers - Use HttpHeaders to provide eg. authentication data. Must not be null.hosts - must not be null nor empty!DefaultReactiveElasticsearchClient.public static ReactiveElasticsearchClient create(ClientConfiguration clientConfiguration)
DefaultReactiveElasticsearchClient given ClientConfiguration. HttpHeaders
correctly.clientConfiguration - Client configuration. Must not be null.DefaultReactiveElasticsearchClient.public reactor.core.publisher.Mono<Boolean> ping(HttpHeaders headers)
ReactiveElasticsearchClientping in interface ReactiveElasticsearchClientheaders - Use HttpHeaders to provide eg. authentication data. Must not be null.Mono emitting the result of the ping attempt.public reactor.core.publisher.Mono<org.elasticsearch.action.main.MainResponse> info(HttpHeaders headers)
ReactiveElasticsearchClientinfo in interface ReactiveElasticsearchClientheaders - Use HttpHeaders to provide eg. authentication data. Must not be null.Mono emitting the result of the info request.public reactor.core.publisher.Mono<org.elasticsearch.index.get.GetResult> get(HttpHeaders headers, org.elasticsearch.action.get.GetRequest getRequest)
ReactiveElasticsearchClientGetRequest against the get API to retrieve a document by id.get in interface ReactiveElasticsearchClientheaders - Use HttpHeaders to provide eg. authentication data. Must not be null.getRequest - must not be null.Mono emitting the result.public reactor.core.publisher.Flux<org.elasticsearch.index.get.GetResult> multiGet(HttpHeaders headers, org.elasticsearch.action.get.MultiGetRequest multiGetRequest)
ReactiveElasticsearchClientMultiGetRequest against the multi-get API to retrieve multiple documents by
id.multiGet in interface ReactiveElasticsearchClientheaders - Use HttpHeaders to provide eg. authentication data. Must not be null.multiGetRequest - must not be null.Flux emitting the result.public reactor.core.publisher.Mono<Boolean> exists(HttpHeaders headers, org.elasticsearch.action.get.GetRequest getRequest)
ReactiveElasticsearchClientexists in interface ReactiveElasticsearchClientheaders - Use HttpHeaders to provide eg. authentication data. Must not be null.getRequest - must not be null.Mono emitting true if it exists, false otherwise.public reactor.core.publisher.Mono<org.elasticsearch.action.index.IndexResponse> index(HttpHeaders headers, org.elasticsearch.action.index.IndexRequest indexRequest)
ReactiveElasticsearchClientIndexRequest against the index API to index a document.index in interface ReactiveElasticsearchClientheaders - Use HttpHeaders to provide eg. authentication data. Must not be null.indexRequest - must not be null.Mono emitting the IndexResponse.public reactor.core.publisher.Mono<org.elasticsearch.action.update.UpdateResponse> update(HttpHeaders headers, org.elasticsearch.action.update.UpdateRequest updateRequest)
ReactiveElasticsearchClientUpdateRequest against the update API to alter a document.update in interface ReactiveElasticsearchClientheaders - Use HttpHeaders to provide eg. authentication data. Must not be null.updateRequest - must not be null.Mono emitting the UpdateResponse.public reactor.core.publisher.Mono<org.elasticsearch.action.delete.DeleteResponse> delete(HttpHeaders headers, org.elasticsearch.action.delete.DeleteRequest deleteRequest)
ReactiveElasticsearchClientDeleteRequest against the delete API to remove a document.delete in interface ReactiveElasticsearchClientheaders - Use HttpHeaders to provide eg. authentication data. Must not be null.deleteRequest - must not be null.Mono emitting the DeleteResponse.public reactor.core.publisher.Flux<org.elasticsearch.search.SearchHit> search(HttpHeaders headers, org.elasticsearch.action.search.SearchRequest searchRequest)
ReactiveElasticsearchClientSearchRequest against the search API.search in interface ReactiveElasticsearchClientheaders - Use HttpHeaders to provide eg. authentication data. Must not be null.searchRequest - must not be null.Flux emitting hits one by one.public reactor.core.publisher.Flux<org.elasticsearch.search.SearchHit> scroll(HttpHeaders headers, org.elasticsearch.action.search.SearchRequest searchRequest)
ReactiveElasticsearchClientSearchRequest against the search scroll API. scrollIds returned by the server and provides them when
requesting more results via _search/scroll. All bound server resources are freed on completion.scroll in interface ReactiveElasticsearchClientheaders - Use HttpHeaders to provide eg. authentication data. Must not be null.searchRequest - must not be null.Flux emitting hits one by one.public reactor.core.publisher.Mono<org.elasticsearch.index.reindex.BulkByScrollResponse> deleteBy(HttpHeaders headers, org.elasticsearch.index.reindex.DeleteByQueryRequest deleteRequest)
ReactiveElasticsearchClientDeleteByQueryRequest against the delete by query API.deleteBy in interface ReactiveElasticsearchClientheaders - Use HttpHeaders to provide eg. authentication data. Must not be null.deleteRequest - must not be null.Mono emitting operation response.public reactor.core.publisher.Mono<ClientResponse> execute(ReactiveElasticsearchClient.ReactiveElasticsearchClientCallback callback)
ReactiveElasticsearchClientconnection.
Execute selects an active server from the available ones and
retries operations that fail with a ConnectException on another node if the previously selected one becomes
unavailable.execute in interface ReactiveElasticsearchClientcallback - the callback wielding the actual command to run.Mono emitting the ClientResponse once subscribed.public reactor.core.publisher.Mono<ReactiveElasticsearchClient.Status> status()
ReactiveElasticsearchClientReactiveElasticsearchClient.Status. status in interface ReactiveElasticsearchClientReactiveElasticsearchClient.Status information.Copyright © 2011–2019 Pivotal Software, Inc.. All rights reserved.