public class ElasticSearchClient extends Object implements Client, HealthCheckable
| Constructor and Description |
|---|
ElasticSearchClient(String clusterNodes,
String protocol,
String trustStorePath,
String trustStorePass,
String user,
String password,
Function<String,String> indexNameConverter,
int connectTimeout,
int socketTimeout,
int responseTimeout,
int numHttpClientThread) |
| Modifier and Type | Method and Description |
|---|---|
void |
connect() |
BulkProcessor |
createBulkProcessor(int bulkActions,
int flushInterval,
int concurrentRequests) |
boolean |
createIndex(String indexName) |
boolean |
createIndex(String indexName,
Mappings mappings,
Map<String,?> settings) |
boolean |
createOrUpdateTemplate(String indexName,
Map<String,Object> settings,
Mappings mapping,
int order) |
boolean |
deleteByIndexName(String indexName)
If your indexName is retrieved from elasticsearch through
retrievalIndexByAliases(String) or some other method and it already contains namespace. |
boolean |
deleteScrollContextQuietly(String scrollId) |
boolean |
deleteTemplate(String indexName) |
boolean |
existDoc(String indexName,
String id) |
void |
forceInsert(String indexName,
String id,
Map<String,Object> source) |
void |
forceUpdate(String indexName,
String id,
Map<String,Object> source) |
String |
formatIndexName(String indexName) |
Optional<Document> |
get(String indexName,
String id) |
Optional<Index> |
getIndex(String indexName) |
Optional<IndexTemplate> |
getTemplate(String name) |
Optional<Documents> |
ids(Map<String,List<String>> indexIds)
Provide to get documents from multi indices by IDs.
|
boolean |
isExistsIndex(String indexName) |
boolean |
isExistsTemplate(String indexName) |
IndexRequestWrapper |
prepareInsert(String indexName,
String id,
Map<String,Object> source) |
UpdateRequestWrapper |
prepareUpdate(String indexName,
String id,
Map<String,Object> source) |
void |
registerChecker(HealthChecker healthChecker)
Register health checker.
|
Collection<String> |
retrievalIndexByAliases(String alias) |
SearchResponse |
scroll(Duration contextRetention,
String scrollId) |
SearchResponse |
search(String indexName,
Search search) |
SearchResponse |
search(String indexName,
Search search,
SearchParams params) |
SearchResponse |
search(Supplier<String[]> indices,
Search search) |
SearchResponse |
searchIDs(String indexName,
Iterable<String> ids)
Search by ids with index alias, when can not locate the physical index.
|
void |
shutdown() |
boolean |
updateIndexMapping(String indexName,
Mappings mapping) |
public static final String TYPE
public void registerChecker(HealthChecker healthChecker)
HealthCheckableregisterChecker in interface HealthCheckablehealthChecker - HealthChecker to be registered.public boolean createIndex(String indexName)
public Collection<String> retrievalIndexByAliases(String alias)
public boolean deleteByIndexName(String indexName)
retrievalIndexByAliases(String) or some other method and it already contains namespace.
Then you should delete the index by this method, this method will no longer concatenate
namespace.
https://github.com/apache/skywalking/pull/3017public boolean isExistsIndex(String indexName)
public Optional<IndexTemplate> getTemplate(String name)
public boolean isExistsTemplate(String indexName)
public boolean createOrUpdateTemplate(String indexName, Map<String,Object> settings, Mappings mapping, int order)
public boolean deleteTemplate(String indexName)
public SearchResponse search(Supplier<String[]> indices, Search search)
public SearchResponse search(String indexName, Search search)
public SearchResponse search(String indexName, Search search, SearchParams params)
public SearchResponse scroll(Duration contextRetention, String scrollId)
public boolean deleteScrollContextQuietly(String scrollId)
public Optional<Documents> ids(Map<String,List<String>> indexIds)
indexIds - key: indexName, value: ids listpublic SearchResponse searchIDs(String indexName, Iterable<String> ids)
ids(java.util.Map<java.lang.String, java.util.List<java.lang.String>>)indexName - Index alias name or physical nameids - ID listpublic IndexRequestWrapper prepareInsert(String indexName, String id, Map<String,Object> source)
public UpdateRequestWrapper prepareUpdate(String indexName, String id, Map<String,Object> source)
public BulkProcessor createBulkProcessor(int bulkActions, int flushInterval, int concurrentRequests)
Copyright © 2022 The Apache Software Foundation. All rights reserved.