@Service public class RestHighLevelClientService extends Object
| Constructor and Description |
|---|
RestHighLevelClientService() |
| Modifier and Type | Method and Description |
|---|---|
org.elasticsearch.client.indices.CreateIndexResponse |
createIndex(String indexName,
String settings,
String mapping)
创建索引
|
org.elasticsearch.action.support.master.AcknowledgedResponse |
deleteIndex(String... indexNames)
删除索引
|
org.elasticsearch.action.search.SearchResponse |
getMetaData(String field,
String doc) |
org.elasticsearch.action.bulk.BulkResponse |
importAll(String indexName,
boolean isAutoId,
String source)
批量导入
|
boolean |
importAll(String indexName,
ElasticSearchDoc... sources)
批量导入
|
boolean |
indexExists(String indexName)
判断 index 是否存在
|
org.elasticsearch.action.search.SearchResponse |
search(String field,
String key,
int page,
int size,
String... indexNames)
简单模糊匹配 默认分页为 0,10
|
org.elasticsearch.action.search.SearchResponse |
search(String keyword,
String type,
String source,
int page,
int size)
简单模糊匹配 默认分页为 0,10
|
org.elasticsearch.action.search.SearchResponse |
termSearch(String field,
String key,
int page,
int size,
String... indexNames)
term 查询 精准匹配
|
public org.elasticsearch.client.indices.CreateIndexResponse createIndex(String indexName, String settings, String mapping) throws IOException
IOExceptionpublic org.elasticsearch.action.support.master.AcknowledgedResponse deleteIndex(String... indexNames) throws IOException
IOExceptionpublic boolean indexExists(String indexName) throws IOException
IOExceptionpublic org.elasticsearch.action.search.SearchResponse search(String field, String key, int page, int size, String... indexNames) throws IOException
IOExceptionpublic org.elasticsearch.action.search.SearchResponse search(String keyword, String type, String source, int page, int size) throws IOException
IOExceptionpublic org.elasticsearch.action.search.SearchResponse getMetaData(String field, String doc) throws IOException
IOExceptionpublic org.elasticsearch.action.search.SearchResponse termSearch(String field, String key, int page, int size, String... indexNames) throws IOException
IOExceptionpublic org.elasticsearch.action.bulk.BulkResponse importAll(String indexName, boolean isAutoId, String source) throws IOException
IOExceptionpublic boolean importAll(String indexName, ElasticSearchDoc... sources)
Copyright © 2022. All rights reserved.