@Deprecated public class ElasticsearchTemplate extends AbstractElasticsearchTemplate
AbstractElasticsearchTemplate.DocumentCallback<T>, AbstractElasticsearchTemplate.ReadDocumentCallback<T>, AbstractElasticsearchTemplate.ReadSearchDocumentResponseCallback<T>, AbstractElasticsearchTemplate.ReadSearchScrollDocumentResponseCallback<T>, AbstractElasticsearchTemplate.SearchDocumentResponseCallback<T>
elasticsearchConverter, requestFactory
Constructor and Description |
---|
ElasticsearchTemplate(org.elasticsearch.client.Client client)
Deprecated.
|
ElasticsearchTemplate(org.elasticsearch.client.Client client,
ElasticsearchConverter elasticsearchConverter)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
List<String> |
bulkIndex(List<IndexQuery> queries,
BulkOptions bulkOptions,
IndexCoordinates index)
Deprecated.
Bulk index all objects.
|
void |
bulkUpdate(List<UpdateQuery> queries,
BulkOptions bulkOptions,
IndexCoordinates index)
Deprecated.
Bulk update all objects.
|
long |
count(Query query,
Class<?> clazz,
IndexCoordinates index)
Deprecated.
return number of elements found by given query
|
void |
delete(DeleteQuery deleteQuery,
IndexCoordinates index)
Deprecated.
|
String |
delete(Object entity,
IndexCoordinates index)
Deprecated.
Deletes the given entity
|
void |
delete(Query query,
Class<?> clazz,
IndexCoordinates index)
Deprecated.
Delete all records matching the query.
|
String |
delete(String id,
IndexCoordinates index)
Deprecated.
Delete the one object with provided id.
|
protected boolean |
doExists(String id,
IndexCoordinates index)
Deprecated.
|
<T> T |
get(String id,
Class<T> clazz,
IndexCoordinates index)
Deprecated.
Retrieves an object from the index specified in the entity's Document annotation.
|
org.elasticsearch.client.Client |
getClient()
Deprecated.
|
protected String |
getClusterVersion()
Deprecated.
tries to extract the version of the Elasticsearch cluster
|
protected org.elasticsearch.action.search.MultiSearchResponse.Item[] |
getMultiSearchResult(org.elasticsearch.action.search.MultiSearchRequest request)
Deprecated.
|
String |
getSearchTimeout()
Deprecated.
|
String |
index(IndexQuery query,
IndexCoordinates index)
Deprecated.
Index an object.
|
IndexOperations |
indexOps(Class<?> clazz)
Deprecated.
get an
IndexOperations that is bound to the given class |
IndexOperations |
indexOps(IndexCoordinates index)
Deprecated.
get an
IndexOperations that is bound to the given class |
<T> List<T> |
multiGet(Query query,
Class<T> clazz,
IndexCoordinates index)
Deprecated.
Execute a multiGet against elasticsearch for the given ids.
|
<T> SearchHits<T> |
search(Query query,
Class<T> clazz,
IndexCoordinates index)
Deprecated.
Execute the criteria query against elasticsearch and return result as
SearchHits |
void |
searchScrollClear(List<String> scrollIds)
Deprecated.
|
<T> SearchScrollHits<T> |
searchScrollContinue(String scrollId,
long scrollTimeInMillis,
Class<T> clazz,
IndexCoordinates index)
Deprecated.
|
<T> SearchScrollHits<T> |
searchScrollStart(long scrollTimeInMillis,
Query query,
Class<T> clazz,
IndexCoordinates index)
Deprecated.
|
void |
setSearchTimeout(String searchTimeout)
Deprecated.
|
org.elasticsearch.action.search.SearchResponse |
suggest(org.elasticsearch.search.suggest.SuggestBuilder suggestion,
IndexCoordinates index)
Deprecated.
Does a suggest query
|
UpdateResponse |
update(UpdateQuery query,
IndexCoordinates index)
Deprecated.
Partial update of the document.
|
checkForBulkOperationFailure, count, createElasticsearchConverter, delete, delete, exists, exists, get, get, getElasticsearchConverter, getIndexCoordinatesFor, getRequestFactory, initialize, maybeCallbackAfterConvert, maybeCallbackAfterSave, maybeCallbackAfterSaveWithQueries, maybeCallbackAfterSaveWithQuery, maybeCallbackBeforeConvert, maybeCallbackBeforeConvertWithQueries, maybeCallbackBeforeConvertWithQuery, multiSearch, multiSearch, queryForObject, save, save, save, save, save, search, search, search, searchForStream, searchForStream, searchScrollClear, setApplicationContext, setEntityCallbacks, setPersistentEntityId, stream, toArray
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addAlias, createIndex, createIndex, createIndex, createIndex, deleteIndex, deleteIndex, deleteIndex, getDocument, getMapping, getMapping, getSetting, getSetting, getSettings, getSettings, indexExists, indexExists, putMapping, putMapping, putMapping, putMapping, queryForAlias, refresh, refresh, removeAlias, stringIdRepresentation
bulkIndex, bulkUpdate
count, moreLikeThis, queryForIds, queryForList, queryForList, queryForList, queryForObject, queryForPage, queryForPage, queryForPage, searchOne, searchOne
public ElasticsearchTemplate(org.elasticsearch.client.Client client)
public ElasticsearchTemplate(org.elasticsearch.client.Client client, ElasticsearchConverter elasticsearchConverter)
public IndexOperations indexOps(Class<?> clazz)
ElasticsearchOperations
IndexOperations
that is bound to the given classpublic IndexOperations indexOps(IndexCoordinates index)
ElasticsearchOperations
IndexOperations
that is bound to the given classpublic void setSearchTimeout(String searchTimeout)
public String index(IndexQuery query, IndexCoordinates index)
DocumentOperations
query
- the query defining the objectindex
- the index where the object is stored.@Nullable public <T> T get(String id, Class<T> clazz, IndexCoordinates index)
DocumentOperations
id
- the id of the objectclazz
- the entity class,index
- the index from which the object is read.public <T> List<T> multiGet(Query query, Class<T> clazz, IndexCoordinates index)
DocumentOperations
query
- the query defining the ids of the objects to getclazz
- the type of the object to be returnedindex
- the index(es) from which the objects are read.protected boolean doExists(String id, IndexCoordinates index)
doExists
in class AbstractElasticsearchTemplate
public List<String> bulkIndex(List<IndexQuery> queries, BulkOptions bulkOptions, IndexCoordinates index)
DocumentOperations
queries
- the queries to execute in bulkbulkOptions
- options to be added to the bulk requestpublic void bulkUpdate(List<UpdateQuery> queries, BulkOptions bulkOptions, IndexCoordinates index)
DocumentOperations
queries
- the queries to execute in bulkbulkOptions
- options to be added to the bulk requestpublic String delete(String id, IndexCoordinates index)
DocumentOperations
id
- the document ot deleteindex
- the index from which to delete@Deprecated public void delete(DeleteQuery deleteQuery, IndexCoordinates index)
DocumentOperations
deleteQuery
- query defining the objectsindex
- the index where to delete the recordspublic void delete(Query query, Class<?> clazz, IndexCoordinates index)
DocumentOperations
query
- query defining the objectsclazz
- The entity class, must be annotated with
Document
index
- the index from which to deletepublic String delete(Object entity, IndexCoordinates index)
DocumentOperations
delete
in interface DocumentOperations
delete
in class AbstractElasticsearchTemplate
entity
- the entity to deleteindex
- the index from which to deletepublic UpdateResponse update(UpdateQuery query, IndexCoordinates index)
DocumentOperations
query
- query defining the updateindex
- the index where to update the recordspublic long count(Query query, @Nullable Class<?> clazz, IndexCoordinates index)
SearchOperations
query
- the query to executeclazz
- the entity clazz used for property mappingindex
- the index to run the query againstpublic <T> SearchHits<T> search(Query query, Class<T> clazz, IndexCoordinates index)
SearchOperations
SearchHits
T
- element return typequery
- the query to executeclazz
- the entity clazz used for property mappingindex
- the index to run the query againstpublic <T> SearchScrollHits<T> searchScrollStart(long scrollTimeInMillis, Query query, Class<T> clazz, IndexCoordinates index)
searchScrollStart
in class AbstractElasticsearchTemplate
public <T> SearchScrollHits<T> searchScrollContinue(@Nullable String scrollId, long scrollTimeInMillis, Class<T> clazz, IndexCoordinates index)
searchScrollContinue
in class AbstractElasticsearchTemplate
public void searchScrollClear(List<String> scrollIds)
searchScrollClear
in class AbstractElasticsearchTemplate
public org.elasticsearch.action.search.SearchResponse suggest(org.elasticsearch.search.suggest.SuggestBuilder suggestion, IndexCoordinates index)
SearchOperations
suggestion
- the queryindex
- the index to run the query againstprotected org.elasticsearch.action.search.MultiSearchResponse.Item[] getMultiSearchResult(org.elasticsearch.action.search.MultiSearchRequest request)
getMultiSearchResult
in class AbstractElasticsearchTemplate
protected String getClusterVersion()
AbstractElasticsearchTemplate
getClusterVersion
in class AbstractElasticsearchTemplate
public org.elasticsearch.client.Client getClient()
Copyright © 2011–2021 Pivotal Software, Inc.. All rights reserved.