public class RestHighLevelClientX extends Object
| Constructor and Description |
|---|
RestHighLevelClientX(org.elasticsearch.client.RestHighLevelClient restHighLevelClient) |
| Modifier and Type | Method and Description |
|---|---|
RestHighLevelClientX |
async()
using async way
|
org.elasticsearch.client.RestHighLevelClient |
client() |
boolean |
createIndex(String index,
org.elasticsearch.common.settings.Settings settings,
MappingsProperties mappingsProperties) |
boolean |
deleteByDocId(String index,
String docId) |
boolean |
deleteByDocId(String index,
String docId,
org.elasticsearch.action.support.WriteRequest.RefreshPolicy refreshPolicy) |
boolean |
deleteByDocIds(String index,
List<String> docIds) |
boolean |
deleteByDocIds(String index,
List<String> docIds,
org.elasticsearch.action.support.WriteRequest.RefreshPolicy refreshPolicy) |
boolean |
deleteByDocIds(String index,
List<String> docIds,
org.elasticsearch.action.support.WriteRequest.RefreshPolicy refreshPolicy,
org.elasticsearch.client.RequestOptions options) |
Map<String,Object> |
findAsMapById(String index,
String docId) |
List<Map<String,Object>> |
findAsMapByIds(String index,
List<String> docIds) |
<T> T |
findById(Class<T> clazz,
String index,
String docId) |
<T> List<T> |
findByIds(Class<T> clazz,
String index,
List<String> docIds) |
boolean |
partialUpdate(List<org.elasticsearch.action.update.UpdateRequest> updateRequests) |
boolean |
partialUpdate(List<org.elasticsearch.action.update.UpdateRequest> updateRequests,
org.elasticsearch.action.support.WriteRequest.RefreshPolicy refreshPolicy) |
boolean |
partialUpdate(List<org.elasticsearch.action.update.UpdateRequest> updateRequests,
org.elasticsearch.action.support.WriteRequest.RefreshPolicy refreshPolicy,
org.elasticsearch.client.RequestOptions options) |
boolean |
partialUpdate(String index,
String docId,
Map<String,Object> map) |
boolean |
partialUpdate(String index,
String docId,
Map<String,Object> map,
org.elasticsearch.action.support.WriteRequest.RefreshPolicy refreshPolicy) |
boolean |
partialUpdate(String index,
String docId,
String json) |
boolean |
partialUpdate(String index,
String docId,
String json,
org.elasticsearch.action.support.WriteRequest.RefreshPolicy refreshPolicy) |
boolean |
partialUpdate(String index,
String docId,
String source,
org.elasticsearch.common.xcontent.XContentType xContentType) |
boolean |
partialUpdate(String index,
String docId,
String source,
org.elasticsearch.common.xcontent.XContentType xContentType,
org.elasticsearch.action.support.WriteRequest.RefreshPolicy refreshPolicy) |
boolean |
partialUpdate(org.elasticsearch.action.update.UpdateRequest updateRequest) |
boolean |
partialUpdate(org.elasticsearch.action.update.UpdateRequest updateRequest,
org.elasticsearch.action.support.WriteRequest.RefreshPolicy refreshPolicy) |
boolean |
partialUpdateByDocBuilders(List<DocBuilder> builders) |
boolean |
partialUpdateByDocBuilders(List<DocBuilder> builders,
org.elasticsearch.action.support.WriteRequest.RefreshPolicy refreshPolicy) |
boolean |
partialUpdateByDocBuilders(List<DocBuilder> builders,
org.elasticsearch.action.support.WriteRequest.RefreshPolicy refreshPolicy,
org.elasticsearch.client.RequestOptions options) |
boolean |
partialUpdateDocs(List<org.elasticsearch.action.update.UpdateRequest> updateRequests) |
boolean |
partialUpdateDocs(List<org.elasticsearch.action.update.UpdateRequest> updateRequests,
org.elasticsearch.action.support.WriteRequest.RefreshPolicy refreshPolicy) |
boolean |
partialUpdateDocs(List<org.elasticsearch.action.update.UpdateRequest> updateRequests,
org.elasticsearch.action.support.WriteRequest.RefreshPolicy refreshPolicy,
org.elasticsearch.client.RequestOptions options) |
<T> List<T> |
randomRecommend(Class<T> clazz,
String index,
int recommendSize)
random Recommend some docs
|
<T> List<T> |
randomRecommend(Class<T> clazz,
String index,
int recommendSize,
org.elasticsearch.index.query.QueryBuilder queryBuilder,
org.elasticsearch.search.fetch.subphase.highlight.HighlightBuilder highlightBuilder)
random Recommend some docs
|
<T> List<T> |
randomRecommend(Class<T> clazz,
String index,
int recommendSize,
org.elasticsearch.index.query.QueryBuilder queryBuilder,
org.elasticsearch.search.fetch.subphase.highlight.HighlightBuilder highlightBuilder,
String docIdFieldName,
List<String> excludeDocIds)
random Recommend some docs
|
boolean |
saveOrUpdate(org.elasticsearch.action.index.IndexRequest indexRequest) |
boolean |
saveOrUpdate(org.elasticsearch.action.index.IndexRequest indexRequest,
org.elasticsearch.action.support.WriteRequest.RefreshPolicy refreshPolicy) |
boolean |
saveOrUpdate(String index,
String docId,
Map<String,Object> map) |
boolean |
saveOrUpdate(String index,
String docId,
Map<String,Object> map,
org.elasticsearch.action.support.WriteRequest.RefreshPolicy refreshPolicy) |
boolean |
saveOrUpdate(String index,
String docId,
String json) |
boolean |
saveOrUpdate(String index,
String docId,
String json,
org.elasticsearch.action.support.WriteRequest.RefreshPolicy refreshPolicy) |
boolean |
saveOrUpdate(String index,
String docId,
String source,
org.elasticsearch.common.xcontent.XContentType xContentType) |
boolean |
saveOrUpdate(String index,
String docId,
String source,
org.elasticsearch.common.xcontent.XContentType xContentType,
org.elasticsearch.action.support.WriteRequest.RefreshPolicy refreshPolicy) |
boolean |
saveOrUpdateByDocBuilders(List<DocBuilder> builders) |
boolean |
saveOrUpdateByDocBuilders(List<DocBuilder> builders,
org.elasticsearch.action.support.WriteRequest.RefreshPolicy refreshPolicy) |
boolean |
saveOrUpdateByDocBuilders(List<DocBuilder> builders,
org.elasticsearch.action.support.WriteRequest.RefreshPolicy refreshPolicy,
org.elasticsearch.client.RequestOptions options) |
boolean |
saveOrUpdateDocs(List<org.elasticsearch.action.index.IndexRequest> indexRequests) |
boolean |
saveOrUpdateDocs(List<org.elasticsearch.action.index.IndexRequest> indexRequests,
org.elasticsearch.action.support.WriteRequest.RefreshPolicy refreshPolicy) |
boolean |
saveOrUpdateDocs(List<org.elasticsearch.action.index.IndexRequest> indexRequests,
org.elasticsearch.action.support.WriteRequest.RefreshPolicy refreshPolicy,
org.elasticsearch.client.RequestOptions options) |
<T> org.springframework.data.elasticsearch.core.aggregation.impl.AggregatedPageImpl<T> |
searchForPage(Class<T> clazz,
String index,
org.elasticsearch.search.builder.SearchSourceBuilder searchSourceBuilder,
int pageNumber,
int pageSize)
search for page, automatic highlight the result ref the searchSourceBuilder.
|
RestHighLevelClientX |
sync()
using sync way
|
public RestHighLevelClientX(org.elasticsearch.client.RestHighLevelClient restHighLevelClient)
public org.elasticsearch.client.RestHighLevelClient client()
public RestHighLevelClientX async()
public RestHighLevelClientX sync()
public boolean createIndex(String index, org.elasticsearch.common.settings.Settings settings, MappingsProperties mappingsProperties) throws IOException
IOExceptionpublic boolean saveOrUpdate(String index, String docId, Map<String,Object> map) throws IOException
IOExceptionpublic boolean saveOrUpdate(String index, String docId, Map<String,Object> map, org.elasticsearch.action.support.WriteRequest.RefreshPolicy refreshPolicy) throws IOException
IOExceptionpublic boolean saveOrUpdate(String index, String docId, String json) throws IOException
IOExceptionpublic boolean saveOrUpdate(String index, String docId, String json, org.elasticsearch.action.support.WriteRequest.RefreshPolicy refreshPolicy) throws IOException
IOExceptionpublic boolean saveOrUpdate(String index, String docId, String source, org.elasticsearch.common.xcontent.XContentType xContentType) throws IOException
IOExceptionpublic boolean saveOrUpdate(String index, String docId, String source, org.elasticsearch.common.xcontent.XContentType xContentType, org.elasticsearch.action.support.WriteRequest.RefreshPolicy refreshPolicy) throws IOException
IOExceptionpublic boolean saveOrUpdate(org.elasticsearch.action.index.IndexRequest indexRequest)
throws IOException
IOExceptionpublic boolean saveOrUpdate(org.elasticsearch.action.index.IndexRequest indexRequest,
org.elasticsearch.action.support.WriteRequest.RefreshPolicy refreshPolicy)
throws IOException
IOExceptionpublic boolean saveOrUpdateDocs(List<org.elasticsearch.action.index.IndexRequest> indexRequests) throws IOException
IOExceptionpublic boolean saveOrUpdateDocs(List<org.elasticsearch.action.index.IndexRequest> indexRequests, org.elasticsearch.action.support.WriteRequest.RefreshPolicy refreshPolicy) throws IOException
IOExceptionpublic boolean saveOrUpdateDocs(List<org.elasticsearch.action.index.IndexRequest> indexRequests, org.elasticsearch.action.support.WriteRequest.RefreshPolicy refreshPolicy, org.elasticsearch.client.RequestOptions options) throws IOException
IOExceptionpublic boolean saveOrUpdateByDocBuilders(List<DocBuilder> builders) throws IOException
IOExceptionpublic boolean saveOrUpdateByDocBuilders(List<DocBuilder> builders, org.elasticsearch.action.support.WriteRequest.RefreshPolicy refreshPolicy) throws IOException
IOExceptionpublic boolean saveOrUpdateByDocBuilders(List<DocBuilder> builders, org.elasticsearch.action.support.WriteRequest.RefreshPolicy refreshPolicy, org.elasticsearch.client.RequestOptions options) throws IOException
IOExceptionpublic boolean partialUpdate(String index, String docId, Map<String,Object> map) throws IOException
IOExceptionpublic boolean partialUpdate(String index, String docId, Map<String,Object> map, org.elasticsearch.action.support.WriteRequest.RefreshPolicy refreshPolicy) throws IOException
IOExceptionpublic boolean partialUpdate(String index, String docId, String json) throws IOException
IOExceptionpublic boolean partialUpdate(String index, String docId, String json, org.elasticsearch.action.support.WriteRequest.RefreshPolicy refreshPolicy) throws IOException
IOExceptionpublic boolean partialUpdate(String index, String docId, String source, org.elasticsearch.common.xcontent.XContentType xContentType) throws IOException
IOExceptionpublic boolean partialUpdate(String index, String docId, String source, org.elasticsearch.common.xcontent.XContentType xContentType, org.elasticsearch.action.support.WriteRequest.RefreshPolicy refreshPolicy) throws IOException
IOExceptionpublic boolean partialUpdate(org.elasticsearch.action.update.UpdateRequest updateRequest)
throws IOException
IOExceptionpublic boolean partialUpdate(org.elasticsearch.action.update.UpdateRequest updateRequest,
org.elasticsearch.action.support.WriteRequest.RefreshPolicy refreshPolicy)
throws IOException
IOExceptionpublic boolean partialUpdate(List<org.elasticsearch.action.update.UpdateRequest> updateRequests) throws IOException
IOExceptionpublic boolean partialUpdate(List<org.elasticsearch.action.update.UpdateRequest> updateRequests, org.elasticsearch.action.support.WriteRequest.RefreshPolicy refreshPolicy) throws IOException
IOExceptionpublic boolean partialUpdate(List<org.elasticsearch.action.update.UpdateRequest> updateRequests, org.elasticsearch.action.support.WriteRequest.RefreshPolicy refreshPolicy, org.elasticsearch.client.RequestOptions options) throws IOException
IOExceptionpublic boolean partialUpdateDocs(List<org.elasticsearch.action.update.UpdateRequest> updateRequests) throws IOException
IOExceptionpublic boolean partialUpdateDocs(List<org.elasticsearch.action.update.UpdateRequest> updateRequests, org.elasticsearch.action.support.WriteRequest.RefreshPolicy refreshPolicy) throws IOException
IOExceptionpublic boolean partialUpdateDocs(List<org.elasticsearch.action.update.UpdateRequest> updateRequests, org.elasticsearch.action.support.WriteRequest.RefreshPolicy refreshPolicy, org.elasticsearch.client.RequestOptions options) throws IOException
IOExceptionpublic boolean partialUpdateByDocBuilders(List<DocBuilder> builders) throws IOException
IOExceptionpublic boolean partialUpdateByDocBuilders(List<DocBuilder> builders, org.elasticsearch.action.support.WriteRequest.RefreshPolicy refreshPolicy) throws IOException
IOExceptionpublic boolean partialUpdateByDocBuilders(List<DocBuilder> builders, org.elasticsearch.action.support.WriteRequest.RefreshPolicy refreshPolicy, org.elasticsearch.client.RequestOptions options) throws IOException
IOExceptionpublic boolean deleteByDocId(String index, String docId) throws IOException
IOExceptionpublic boolean deleteByDocId(String index, String docId, org.elasticsearch.action.support.WriteRequest.RefreshPolicy refreshPolicy) throws IOException
IOExceptionpublic boolean deleteByDocIds(String index, List<String> docIds) throws IOException
IOExceptionpublic boolean deleteByDocIds(String index, List<String> docIds, org.elasticsearch.action.support.WriteRequest.RefreshPolicy refreshPolicy) throws IOException
IOExceptionpublic boolean deleteByDocIds(String index, List<String> docIds, org.elasticsearch.action.support.WriteRequest.RefreshPolicy refreshPolicy, org.elasticsearch.client.RequestOptions options) throws IOException
IOExceptionpublic Map<String,Object> findAsMapById(String index, String docId) throws IOException
IOExceptionpublic <T> T findById(Class<T> clazz, String index, String docId) throws IOException
IOExceptionpublic List<Map<String,Object>> findAsMapByIds(String index, List<String> docIds) throws IOException
IOExceptionpublic <T> List<T> findByIds(Class<T> clazz, String index, List<String> docIds) throws IOException
IOExceptionpublic <T> org.springframework.data.elasticsearch.core.aggregation.impl.AggregatedPageImpl<T> searchForPage(Class<T> clazz, String index, org.elasticsearch.search.builder.SearchSourceBuilder searchSourceBuilder, int pageNumber, int pageSize) throws IOException
T - clazz - result classindex - es doc indexsearchSourceBuilder - search source parameterpageNumber - page numberpageSize - result size per pageIOExceptionpublic <T> List<T> randomRecommend(Class<T> clazz, String index, int recommendSize) throws IOException
T - clazz - result classindex - es doc indexrecommendSize - recommend doc size, if size <= 0 reset to 8IOExceptionpublic <T> List<T> randomRecommend(Class<T> clazz, String index, int recommendSize, org.elasticsearch.index.query.QueryBuilder queryBuilder, org.elasticsearch.search.fetch.subphase.highlight.HighlightBuilder highlightBuilder) throws IOException
T - clazz - result classindex - es doc indexrecommendSize - recommend doc size, if size <= 0 reset to 8highlightBuilder - highlight or notIOExceptionpublic <T> List<T> randomRecommend(Class<T> clazz, String index, int recommendSize, org.elasticsearch.index.query.QueryBuilder queryBuilder, org.elasticsearch.search.fetch.subphase.highlight.HighlightBuilder highlightBuilder, String docIdFieldName, List<String> excludeDocIds) throws IOException
T - clazz - result classindex - es doc indexrecommendSize - recommend doc size, if size <= 0 reset to 8queryBuilder - query data for highlightBuilderhighlightBuilder - highlight or notdocIdFieldName - doc id field nameexcludeDocIds - exclude doc idsIOExceptionCopyright © 2021. All rights reserved.