Package org.nuxeo.elasticsearch.client
Class ESTransportClient
- java.lang.Object
-
- org.nuxeo.elasticsearch.client.ESTransportClient
-
- All Implemented Interfaces:
AutoCloseable
,ESClient
public class ESTransportClient extends Object implements ESClient
- Since:
- 9.3
-
-
Field Summary
Fields Modifier and Type Field Description protected org.elasticsearch.client.Client
client
-
Constructor Summary
Constructors Constructor Description ESTransportClient(org.elasticsearch.client.Client client)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
aliasExists(String aliasName)
org.elasticsearch.action.bulk.BulkResponse
bulk(org.elasticsearch.action.bulk.BulkRequest request)
org.elasticsearch.action.bulk.BulkProcessor.Builder
bulkProcessorBuilder(org.elasticsearch.action.bulk.BulkProcessor.Listener listener)
Creates an elasticsearch BulkProcessor builder.org.elasticsearch.action.search.ClearScrollResponse
clearScroll(org.elasticsearch.action.search.ClearScrollRequest request)
void
close()
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)
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)
String
getMapping(String indexName)
Returns the mapping from elastic, exposed for testing purposesString
getNodesInfo()
String
getNodesStats()
org.elasticsearch.action.index.IndexResponse
index(org.elasticsearch.action.index.IndexRequest request)
Performs the indexing 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)
-
-
-
Method Detail
-
waitForYellowStatus
public boolean waitForYellowStatus(String[] indexNames, int timeoutSecond)
- Specified by:
waitForYellowStatus
in interfaceESClient
-
getHealthStatus
public org.elasticsearch.cluster.health.ClusterHealthStatus getHealthStatus(String[] indexNames)
- Specified by:
getHealthStatus
in interfaceESClient
-
indexExists
public boolean indexExists(String indexName)
- Specified by:
indexExists
in interfaceESClient
-
mappingExists
public boolean mappingExists(String indexName, String type)
- Specified by:
mappingExists
in interfaceESClient
-
deleteIndex
public void deleteIndex(String indexName, int timeoutSecond)
- Specified by:
deleteIndex
in interfaceESClient
-
createIndex
public void createIndex(String indexName, String jsonSettings)
- Specified by:
createIndex
in interfaceESClient
-
createMapping
public void createMapping(String indexName, String type, String jsonMapping)
- Specified by:
createMapping
in interfaceESClient
-
getMapping
public String getMapping(String indexName)
Description copied from interface:ESClient
Returns the mapping from elastic, exposed for testing purposes- Specified by:
getMapping
in interfaceESClient
-
getNodesInfo
public String getNodesInfo()
- Specified by:
getNodesInfo
in interfaceESClient
-
getNodesStats
public String getNodesStats()
- Specified by:
getNodesStats
in interfaceESClient
-
aliasExists
public boolean aliasExists(String aliasName)
- Specified by:
aliasExists
in interfaceESClient
-
getFirstIndexForAlias
public String getFirstIndexForAlias(String aliasName)
Description copied from interface:ESClient
Returns the name of the index referenced by the alias. Returns null if the alias does not exists.- Specified by:
getFirstIndexForAlias
in interfaceESClient
-
updateAlias
public void updateAlias(String aliasName, String indexName)
- Specified by:
updateAlias
in interfaceESClient
-
bulk
public org.elasticsearch.action.bulk.BulkResponse bulk(org.elasticsearch.action.bulk.BulkRequest request)
-
delete
public org.elasticsearch.action.delete.DeleteResponse delete(org.elasticsearch.action.delete.DeleteRequest request)
-
search
public org.elasticsearch.action.search.SearchResponse search(org.elasticsearch.action.search.SearchRequest request)
-
searchScroll
public org.elasticsearch.action.search.SearchResponse searchScroll(org.elasticsearch.action.search.SearchScrollRequest request)
- Specified by:
searchScroll
in interfaceESClient
-
get
public org.elasticsearch.action.get.GetResponse get(org.elasticsearch.action.get.GetRequest request)
-
index
public org.elasticsearch.action.index.IndexResponse index(org.elasticsearch.action.index.IndexRequest request)
Description copied from interface:ESClient
Performs the indexing request.
-
clearScroll
public org.elasticsearch.action.search.ClearScrollResponse clearScroll(org.elasticsearch.action.search.ClearScrollRequest request)
- Specified by:
clearScroll
in interfaceESClient
-
bulkProcessorBuilder
public org.elasticsearch.action.bulk.BulkProcessor.Builder bulkProcessorBuilder(org.elasticsearch.action.bulk.BulkProcessor.Listener listener)
Description copied from interface:ESClient
Creates an elasticsearch BulkProcessor builder.- Specified by:
bulkProcessorBuilder
in interfaceESClient
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
-
-