public class DefaultReactiveElasticsearchClient extends Object implements ReactiveElasticsearchClient, ReactiveElasticsearchClient.Indices
WebClient based ReactiveElasticsearchClient that connects to an Elasticsearch cluster using HTTP.ClientConfiguration,
ReactiveRestClientsReactiveElasticsearchClient.Indices, ReactiveElasticsearchClient.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 |
|---|---|
reactor.core.publisher.Mono<Void> |
closeIndex(HttpHeaders headers,
org.elasticsearch.action.admin.indices.close.CloseIndexRequest closeIndexRequest)
Execute the given
CloseIndexRequest against the indices API. |
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<Void> |
createIndex(HttpHeaders headers,
org.elasticsearch.action.admin.indices.create.CreateIndexRequest createIndexRequest)
Execute the given
CreateIndexRequest against the indices API. |
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<Void> |
deleteIndex(HttpHeaders headers,
org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest request)
Execute the given
DeleteIndexRequest against the indices 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<Boolean> |
existsIndex(HttpHeaders headers,
org.elasticsearch.action.admin.indices.get.GetIndexRequest request)
Execute the given
GetIndexRequest against the indices API. |
reactor.core.publisher.Mono<Void> |
flushIndex(HttpHeaders headers,
org.elasticsearch.action.admin.indices.flush.FlushRequest flushRequest)
Execute the given
RefreshRequest against the indices API. |
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. |
ReactiveElasticsearchClient.Indices |
indices()
Gain access to index related commands.
|
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<Void> |
openIndex(HttpHeaders headers,
org.elasticsearch.action.admin.indices.open.OpenIndexRequest request)
Execute the given
OpenIndexRequest against the indices API. |
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.Mono<Void> |
refreshIndex(HttpHeaders headers,
org.elasticsearch.action.admin.indices.refresh.RefreshRequest refreshRequest)
Execute the given
RefreshRequest against the indices API. |
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. |
reactor.core.publisher.Mono<Void> |
updateMapping(HttpHeaders headers,
org.elasticsearch.action.admin.indices.mapping.put.PutMappingRequest putMappingRequest)
Execute the given
PutMappingRequest against the indices API. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdelete, delete, deleteBy, deleteBy, exists, exists, get, get, index, index, info, multiGet, multiGet, ping, scroll, search, search, update, updatecloseIndex, closeIndex, createIndex, createIndex, deleteIndex, deleteIndex, existsIndex, existsIndex, flushIndex, flushIndex, openIndex, openIndex, refreshIndex, refreshIndex, updateMapping, updateMappingpublic 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 ReactiveElasticsearchClient.Indices indices()
ReactiveElasticsearchClientindices in interface ReactiveElasticsearchClientpublic 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<Boolean> existsIndex(HttpHeaders headers, org.elasticsearch.action.admin.indices.get.GetIndexRequest request)
ReactiveElasticsearchClient.IndicesGetIndexRequest against the indices API.existsIndex in interface ReactiveElasticsearchClient.Indicesheaders - Use HttpHeaders to provide eg. authentication data. Must not be null.request - must not be null.Mono emitting true if the index exists, false otherwise.public reactor.core.publisher.Mono<Void> deleteIndex(HttpHeaders headers, org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest request)
ReactiveElasticsearchClient.IndicesDeleteIndexRequest against the indices API.deleteIndex in interface ReactiveElasticsearchClient.Indicesheaders - Use HttpHeaders to provide eg. authentication data. Must not be null.request - must not be null.Mono signalling operation completion or an error if eg. the index
does not exist.public reactor.core.publisher.Mono<Void> createIndex(HttpHeaders headers, org.elasticsearch.action.admin.indices.create.CreateIndexRequest createIndexRequest)
ReactiveElasticsearchClient.IndicesCreateIndexRequest against the indices API.createIndex in interface ReactiveElasticsearchClient.Indicesheaders - Use HttpHeaders to provide eg. authentication data. Must not be null.createIndexRequest - must not be null.Mono signalling operation completion or an error if eg. the index
already exist.public reactor.core.publisher.Mono<Void> openIndex(HttpHeaders headers, org.elasticsearch.action.admin.indices.open.OpenIndexRequest request)
ReactiveElasticsearchClient.IndicesOpenIndexRequest against the indices API.openIndex in interface ReactiveElasticsearchClient.Indicesheaders - Use HttpHeaders to provide eg. authentication data. Must not be null.request - must not be null.Mono signalling operation completion or an error if eg. the index
does not exist.public reactor.core.publisher.Mono<Void> closeIndex(HttpHeaders headers, org.elasticsearch.action.admin.indices.close.CloseIndexRequest closeIndexRequest)
ReactiveElasticsearchClient.IndicesCloseIndexRequest against the indices API.closeIndex in interface ReactiveElasticsearchClient.Indicesheaders - Use HttpHeaders to provide eg. authentication data. Must not be null.closeIndexRequest - must not be null.Mono signalling operation completion or an error if eg. the index
does not exist.public reactor.core.publisher.Mono<Void> refreshIndex(HttpHeaders headers, org.elasticsearch.action.admin.indices.refresh.RefreshRequest refreshRequest)
ReactiveElasticsearchClient.IndicesRefreshRequest against the indices API.refreshIndex in interface ReactiveElasticsearchClient.Indicesheaders - Use HttpHeaders to provide eg. authentication data. Must not be null.refreshRequest - must not be null.Mono signalling operation completion or an error if eg. the index
does not exist.public reactor.core.publisher.Mono<Void> updateMapping(HttpHeaders headers, org.elasticsearch.action.admin.indices.mapping.put.PutMappingRequest putMappingRequest)
ReactiveElasticsearchClient.IndicesPutMappingRequest against the indices API.updateMapping in interface ReactiveElasticsearchClient.Indicesheaders - Use HttpHeaders to provide eg. authentication data. Must not be null.putMappingRequest - must not be null.Mono signalling operation completion or an error if eg. the index
does not exist.public reactor.core.publisher.Mono<Void> flushIndex(HttpHeaders headers, org.elasticsearch.action.admin.indices.flush.FlushRequest flushRequest)
ReactiveElasticsearchClient.IndicesRefreshRequest against the indices API.flushIndex in interface ReactiveElasticsearchClient.Indicesheaders - Use HttpHeaders to provide eg. authentication data. Must not be null.flushRequest - must not be null.Mono signalling operation completion or an error if eg. the index
does not exist.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.