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.Clientclient
-
Constructor Summary
Constructors Constructor Description ESTransportClient(org.elasticsearch.client.Client client)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaliasExists(String aliasName)org.elasticsearch.action.bulk.BulkResponsebulk(org.elasticsearch.action.bulk.BulkRequest request)org.elasticsearch.action.bulk.BulkProcessor.BuilderbulkProcessorBuilder(org.elasticsearch.action.bulk.BulkProcessor.Listener listener)Creates an elasticsearch BulkProcessor builder.org.elasticsearch.action.search.ClearScrollResponseclearScroll(org.elasticsearch.action.search.ClearScrollRequest request)voidclose()voidcreateIndex(String indexName, String jsonSettings)voidcreateMapping(String indexName, String type, String jsonMapping)org.elasticsearch.action.delete.DeleteResponsedelete(org.elasticsearch.action.delete.DeleteRequest request)voiddeleteIndex(String indexName, int timeoutSecond)voidflush(String indexName)org.elasticsearch.action.get.GetResponseget(org.elasticsearch.action.get.GetRequest request)StringgetFirstIndexForAlias(String aliasName)Returns the name of the index referenced by the alias.org.elasticsearch.cluster.health.ClusterHealthStatusgetHealthStatus(String[] indexNames)StringgetMapping(String indexName)Returns the mapping from elastic, exposed for testing purposesStringgetNodesInfo()StringgetNodesStats()org.elasticsearch.action.index.IndexResponseindex(org.elasticsearch.action.index.IndexRequest request)Performs the indexing request.booleanindexExists(String indexName)booleanmappingExists(String indexName, String type)voidoptimize(String indexName)voidrefresh(String indexName)org.elasticsearch.action.search.SearchResponsesearch(org.elasticsearch.action.search.SearchRequest request)org.elasticsearch.action.search.SearchResponsesearchScroll(org.elasticsearch.action.search.SearchScrollRequest request)voidupdateAlias(String aliasName, String indexName)booleanwaitForYellowStatus(String[] indexNames, int timeoutSecond)
-
-
-
Method Detail
-
waitForYellowStatus
public boolean waitForYellowStatus(String[] indexNames, int timeoutSecond)
- Specified by:
waitForYellowStatusin interfaceESClient
-
getHealthStatus
public org.elasticsearch.cluster.health.ClusterHealthStatus getHealthStatus(String[] indexNames)
- Specified by:
getHealthStatusin interfaceESClient
-
indexExists
public boolean indexExists(String indexName)
- Specified by:
indexExistsin interfaceESClient
-
mappingExists
public boolean mappingExists(String indexName, String type)
- Specified by:
mappingExistsin interfaceESClient
-
deleteIndex
public void deleteIndex(String indexName, int timeoutSecond)
- Specified by:
deleteIndexin interfaceESClient
-
createIndex
public void createIndex(String indexName, String jsonSettings)
- Specified by:
createIndexin interfaceESClient
-
createMapping
public void createMapping(String indexName, String type, String jsonMapping)
- Specified by:
createMappingin interfaceESClient
-
getMapping
public String getMapping(String indexName)
Description copied from interface:ESClientReturns the mapping from elastic, exposed for testing purposes- Specified by:
getMappingin interfaceESClient
-
getNodesInfo
public String getNodesInfo()
- Specified by:
getNodesInfoin interfaceESClient
-
getNodesStats
public String getNodesStats()
- Specified by:
getNodesStatsin interfaceESClient
-
aliasExists
public boolean aliasExists(String aliasName)
- Specified by:
aliasExistsin interfaceESClient
-
getFirstIndexForAlias
public String getFirstIndexForAlias(String aliasName)
Description copied from interface:ESClientReturns the name of the index referenced by the alias. Returns null if the alias does not exists.- Specified by:
getFirstIndexForAliasin interfaceESClient
-
updateAlias
public void updateAlias(String aliasName, String indexName)
- Specified by:
updateAliasin 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:
searchScrollin 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:ESClientPerforms the indexing request.
-
clearScroll
public org.elasticsearch.action.search.ClearScrollResponse clearScroll(org.elasticsearch.action.search.ClearScrollRequest request)
- Specified by:
clearScrollin interfaceESClient
-
bulkProcessorBuilder
public org.elasticsearch.action.bulk.BulkProcessor.Builder bulkProcessorBuilder(org.elasticsearch.action.bulk.BulkProcessor.Listener listener)
Description copied from interface:ESClientCreates an elasticsearch BulkProcessor builder.- Specified by:
bulkProcessorBuilderin interfaceESClient
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable
-
-