public class ESRestClient extends Object implements ESClient
Modifier and Type | Field and Description |
---|---|
protected org.elasticsearch.client.RestHighLevelClient |
client |
protected org.elasticsearch.client.RestClient |
lowLevelClient |
Constructor and Description |
---|
ESRestClient(org.elasticsearch.client.RestClient lowLevelRestClient,
org.elasticsearch.client.RestHighLevelClient client) |
Modifier and Type | Method and Description |
---|---|
boolean |
aliasExists(String aliasName) |
org.elasticsearch.action.bulk.BulkResponse |
bulk(org.elasticsearch.action.bulk.BulkRequest request) |
org.elasticsearch.action.search.ClearScrollResponse |
clearScroll(org.elasticsearch.action.search.ClearScrollRequest request) |
void |
close() |
protected void |
createAlias(String aliasName,
String indexName) |
void |
createIndex(String indexName,
String jsonSettings) |
void |
createMapping(String indexName,
String type,
String jsonMapping) |
org.elasticsearch.action.delete.DeleteResponse |
delete(org.elasticsearch.action.delete.DeleteRequest request) |
protected void |
deleteAlias(String aliasName) |
void |
deleteIndex(String indexName,
int timeoutSecond) |
void |
flush(String indexName) |
org.elasticsearch.action.get.GetResponse |
get(org.elasticsearch.action.get.GetRequest request) |
String |
getFirstIndexForAlias(String aliasName)
Returns the name of the index referenced by the alias.
|
org.elasticsearch.cluster.health.ClusterHealthStatus |
getHealthStatus(String[] indexNames) |
protected String |
getIndexesAsString(String[] indexNames) |
String |
getNodesInfo() |
String |
getNodesStats() |
org.elasticsearch.action.index.IndexResponse |
index(org.elasticsearch.action.index.IndexRequest request) |
boolean |
indexExists(String indexName) |
boolean |
mappingExists(String indexName,
String type) |
void |
optimize(String indexName) |
void |
refresh(String indexName) |
org.elasticsearch.action.search.SearchResponse |
search(org.elasticsearch.action.search.SearchRequest request) |
org.elasticsearch.action.search.SearchResponse |
searchScroll(org.elasticsearch.action.search.SearchScrollRequest request) |
void |
updateAlias(String aliasName,
String indexName) |
boolean |
waitForYellowStatus(String[] indexNames,
int timeoutSecond) |
protected org.elasticsearch.client.RestClient lowLevelClient
protected org.elasticsearch.client.RestHighLevelClient client
public ESRestClient(org.elasticsearch.client.RestClient lowLevelRestClient, org.elasticsearch.client.RestHighLevelClient client)
public boolean waitForYellowStatus(String[] indexNames, int timeoutSecond)
waitForYellowStatus
in interface ESClient
protected String getIndexesAsString(String[] indexNames)
public org.elasticsearch.cluster.health.ClusterHealthStatus getHealthStatus(String[] indexNames)
getHealthStatus
in interface ESClient
public boolean indexExists(String indexName)
indexExists
in interface ESClient
public boolean mappingExists(String indexName, String type)
mappingExists
in interface ESClient
public void deleteIndex(String indexName, int timeoutSecond)
deleteIndex
in interface ESClient
public void createIndex(String indexName, String jsonSettings)
createIndex
in interface ESClient
public void createMapping(String indexName, String type, String jsonMapping)
createMapping
in interface ESClient
public String getNodesInfo()
getNodesInfo
in interface ESClient
public String getNodesStats()
getNodesStats
in interface ESClient
public boolean aliasExists(String aliasName)
aliasExists
in interface ESClient
public String getFirstIndexForAlias(String aliasName)
ESClient
getFirstIndexForAlias
in interface ESClient
public void updateAlias(String aliasName, String indexName)
updateAlias
in interface ESClient
protected void deleteAlias(String aliasName)
protected void createAlias(String aliasName, String indexName)
public org.elasticsearch.action.bulk.BulkResponse bulk(org.elasticsearch.action.bulk.BulkRequest request)
public org.elasticsearch.action.delete.DeleteResponse delete(org.elasticsearch.action.delete.DeleteRequest request)
public org.elasticsearch.action.search.SearchResponse search(org.elasticsearch.action.search.SearchRequest request)
public org.elasticsearch.action.search.SearchResponse searchScroll(org.elasticsearch.action.search.SearchScrollRequest request)
searchScroll
in interface ESClient
public org.elasticsearch.action.get.GetResponse get(org.elasticsearch.action.get.GetRequest request)
public org.elasticsearch.action.index.IndexResponse index(org.elasticsearch.action.index.IndexRequest request)
public org.elasticsearch.action.search.ClearScrollResponse clearScroll(org.elasticsearch.action.search.ClearScrollRequest request)
clearScroll
in interface ESClient
public void close()
close
in interface AutoCloseable
Copyright © 2018 Nuxeo. All rights reserved.