public class EsRestClient extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
BulkResponse |
bulk(String requestBody) |
void |
close() |
void |
createIndex(String indexName) |
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) |
static EsRestClient |
createInstance(ReadonlyConfig config) |
void |
dropIndex(String tableName) |
ElasticsearchClusterInfo |
getClusterInfo() |
Map<String,String> |
getFieldTypeMapping(String index,
List<String> source)
get es field name and type mapping realtion
|
List<IndexDocsCount> |
getIndexDocsCount(String index) |
List<String> |
listIndex() |
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?
|
ScrollResult |
searchWithScrollId(String scrollId,
String scrollTime)
scroll to get result call _search/scroll
|
public static EsRestClient createInstance(ReadonlyConfig config)
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)
public BulkResponse bulk(String requestBody)
public ElasticsearchClusterInfo getClusterInfo()
public void close()
public ScrollResult searchByScroll(String index, List<String> source, Map<String,Object> query, String scrollTime, int scrollSize)
index - index namesource - select fieldsscrollTime - such as:1mscrollSize - fetch documents count in one requestpublic ScrollResult searchWithScrollId(String scrollId, String scrollTime)
scrollId - the scroll id of the last requestscrollTime - such as:1mpublic List<IndexDocsCount> getIndexDocsCount(String index)
public void createIndex(String indexName)
public void dropIndex(String tableName)
Copyright © 2024 The Apache Software Foundation. All rights reserved.