类 EsRestClient
- java.lang.Object
-
- org.apache.seatunnel.connectors.seatunnel.elasticsearch.client.EsRestClient
-
public class EsRestClient extends Object
-
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 BulkResponsebulk(String requestBody)voidclearIndexData(String indexName)voidclose()voidcreateIndex(String indexName)voidcreateIndex(String indexName, String mapping)static EsRestClientcreateInstance(List<String> hosts, Optional<String> username, Optional<String> password, boolean tlsVerifyCertificate, boolean tlsVerifyHostnames, Optional<String> keystorePath, Optional<String> keystorePassword, Optional<String> truststorePath, Optional<String> truststorePassword)static EsRestClientcreateInstance(org.apache.seatunnel.api.configuration.ReadonlyConfig config)voiddropIndex(String tableName)ElasticsearchClusterInfogetClusterInfo()Map<String,org.apache.seatunnel.api.table.converter.BasicTypeDefine<EsType>>getFieldTypeMapping(String index, List<String> source)get es field name and type mapping realtionList<IndexDocsCount>getIndexDocsCount(String index)List<String>listIndex()ScrollResultsearchByScroll(String index, List<String> source, Map<String,Object> query, String scrollTime, int scrollSize)first time to request search documents by scroll call /${index}/_search?ScrollResultsearchWithScrollId(String scrollId, String scrollTime)scroll to get result call _search/scroll
-
-
-
方法详细资料
-
createInstance
public static EsRestClient createInstance(org.apache.seatunnel.api.configuration.ReadonlyConfig config)
-
createInstance
public static EsRestClient createInstance(List<String> hosts, Optional<String> username, Optional<String> password, boolean tlsVerifyCertificate, boolean tlsVerifyHostnames, Optional<String> keystorePath, Optional<String> keystorePassword, Optional<String> truststorePath, Optional<String> truststorePassword)
-
bulk
public BulkResponse bulk(String requestBody)
-
getClusterInfo
public ElasticsearchClusterInfo getClusterInfo()
-
close
public void close()
-
searchByScroll
public ScrollResult searchByScroll(String index, List<String> source, Map<String,Object> query, String scrollTime, int scrollSize)
first time to request search documents by scroll call /${index}/_search?scroll=${scroll}- 参数:
index- index namesource- select fieldsscrollTime- such as:1mscrollSize- fetch documents count in one request
-
searchWithScrollId
public ScrollResult searchWithScrollId(String scrollId, String scrollTime)
scroll to get result call _search/scroll- 参数:
scrollId- the scroll id of the last requestscrollTime- such as:1m
-
getIndexDocsCount
public List<IndexDocsCount> getIndexDocsCount(String index)
-
createIndex
public void createIndex(String indexName)
-
dropIndex
public void dropIndex(String tableName)
-
clearIndexData
public void clearIndexData(String indexName)
-
-