public interface DocumentOperations
Modifier and Type | Method and Description |
---|---|
List<IndexedObjectInformation> |
bulkIndex(List<IndexQuery> queries,
BulkOptions bulkOptions,
Class<?> clazz)
Bulk index all objects.
|
List<IndexedObjectInformation> |
bulkIndex(List<IndexQuery> queries,
BulkOptions bulkOptions,
IndexCoordinates index)
Bulk index all objects.
|
default List<IndexedObjectInformation> |
bulkIndex(List<IndexQuery> queries,
Class<?> clazz)
Bulk index all objects.
|
default List<IndexedObjectInformation> |
bulkIndex(List<IndexQuery> queries,
IndexCoordinates index)
Bulk index all objects.
|
void |
bulkUpdate(List<UpdateQuery> queries,
BulkOptions bulkOptions,
IndexCoordinates index)
Bulk update all objects.
|
void |
bulkUpdate(List<UpdateQuery> queries,
Class<?> clazz)
Bulk update all objects.
|
default void |
bulkUpdate(List<UpdateQuery> queries,
IndexCoordinates index)
Bulk update all objects.
|
void |
delete(DeleteQuery query,
IndexCoordinates index)
Deprecated.
since 4.0, use
delete(Query, Class, IndexCoordinates) |
String |
delete(Object entity)
Deletes the given entity
|
String |
delete(Object entity,
IndexCoordinates index)
Deletes the given entity
|
void |
delete(Query query,
Class<?> clazz)
Delete all records matching the query.
|
void |
delete(Query query,
Class<?> clazz,
IndexCoordinates index)
Delete all records matching the query.
|
String |
delete(String id,
Class<?> entityType)
Delete the one object with provided id.
|
default String |
delete(String id,
IndexCoordinates index)
Delete the one object with provided id.
|
String |
delete(String id,
String routing,
IndexCoordinates index)
Delete the one object with provided id.
|
boolean |
exists(String id,
Class<?> clazz)
Check if an entity with given id exists.
|
boolean |
exists(String id,
IndexCoordinates index)
Check if an entity with given id exists.
|
<T> T |
get(GetQuery query,
Class<T> clazz,
IndexCoordinates index)
Deprecated.
since 4.0, use
get(String, Class, IndexCoordinates) |
<T> T |
get(String id,
Class<T> clazz)
Retrieves an object from the index specified in the entity's Document annotation.
|
<T> T |
get(String id,
Class<T> clazz,
IndexCoordinates index)
Retrieves an object from the index specified in the entity's Document annotation.
|
String |
index(IndexQuery query,
IndexCoordinates index)
Index an object.
|
<T> List<T> |
multiGet(Query query,
Class<T> clazz)
Execute a multiGet against elasticsearch for the given ids.
|
<T> List<T> |
multiGet(Query query,
Class<T> clazz,
IndexCoordinates index)
Execute a multiGet against elasticsearch for the given ids.
|
<T> T |
queryForObject(GetQuery query,
Class<T> clazz)
Deprecated.
since 4.0, use
get(String, Class, IndexCoordinates) |
<T> Iterable<T> |
save(Iterable<T> entities)
saves the given entities to the index retrieved from the entities' Document annotation
|
<T> Iterable<T> |
save(Iterable<T> entities,
IndexCoordinates index)
saves the given entities to the given index
|
<T> Iterable<T> |
save(T... entities)
saves the given entities to the index retrieved from the entities' Document annotation
|
<T> T |
save(T entity)
Saves an entity to the index specified in the entity's Document annotation
|
<T> T |
save(T entity,
IndexCoordinates index)
Saves an entity to the index specified in the entity's Document annotation
|
UpdateResponse |
update(UpdateQuery updateQuery,
IndexCoordinates index)
Partial update of the document.
|
<T> T save(T entity)
T
- the entity typeentity
- the entity to save, must not be null<T> T save(T entity, IndexCoordinates index)
T
- the entity typeentity
- the entity to save, must not be nullindex
- the index to save the entity in, must not be null<T> Iterable<T> save(Iterable<T> entities)
T
- the entity typeentities
- must not be null<T> Iterable<T> save(Iterable<T> entities, IndexCoordinates index)
T
- the entity typeentities
- must not be nullindex
- the index to save the entities in, must not be null<T> Iterable<T> save(T... entities)
T
- the entity typeentities
- must not be nullString index(IndexQuery query, IndexCoordinates index)
query
- the query defining the objectindex
- the index where the object is stored.@Nullable <T> T get(String id, Class<T> clazz)
T
- the entity typeid
- the id of the objectclazz
- the entity class,@Nullable <T> T get(String id, Class<T> clazz, IndexCoordinates index)
id
- the id of the objectclazz
- the entity class,index
- the index from which the object is read.<T> List<T> multiGet(Query query, Class<T> clazz)
query
- the query defining the ids of the objects to getclazz
- the type of the object to be returned<T> List<T> multiGet(Query query, Class<T> clazz, IndexCoordinates index)
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.boolean exists(String id, Class<?> clazz)
id
- the _id of the document to look for.clazz
- the domain type used.boolean exists(String id, IndexCoordinates index)
id
- the _id of the document to look for.index
- the target index, must not be nulldefault List<IndexedObjectInformation> bulkIndex(List<IndexQuery> queries, Class<?> clazz)
queries
- the queries to execute in bulkclazz
- the entity classdefault List<IndexedObjectInformation> bulkIndex(List<IndexQuery> queries, IndexCoordinates index)
queries
- the queries to execute in bulkList<IndexedObjectInformation> bulkIndex(List<IndexQuery> queries, BulkOptions bulkOptions, Class<?> clazz)
queries
- the queries to execute in bulkbulkOptions
- options to be added to the bulk requestclazz
- the entity classList<IndexedObjectInformation> bulkIndex(List<IndexQuery> queries, BulkOptions bulkOptions, IndexCoordinates index)
queries
- the queries to execute in bulkbulkOptions
- options to be added to the bulk requestdefault void bulkUpdate(List<UpdateQuery> queries, IndexCoordinates index)
queries
- the queries to execute in bulkvoid bulkUpdate(List<UpdateQuery> queries, Class<?> clazz)
clazz
- the entity classqueries
- the queries to execute in bulkvoid bulkUpdate(List<UpdateQuery> queries, BulkOptions bulkOptions, IndexCoordinates index)
queries
- the queries to execute in bulkbulkOptions
- options to be added to the bulk requestdefault String delete(String id, IndexCoordinates index)
id
- the document to deleteindex
- the index from which to deleteString delete(String id, @Nullable String routing, IndexCoordinates index)
id
- the document to deleterouting
- the optional routing for the document to be deletedindex
- the index from which to deleteString delete(String id, Class<?> entityType)
id
- the document ot deleteentityType
- must not be null.String delete(Object entity)
entity
- the entity to deleteString delete(Object entity, IndexCoordinates index)
entity
- the entity to deleteindex
- the index from which to deletevoid delete(Query query, Class<?> clazz)
query
- query defining the objectsclazz
- The entity class, must be annotated with
Document
void delete(Query query, Class<?> clazz, IndexCoordinates index)
query
- query defining the objectsclazz
- The entity class, must be annotated with
Document
index
- the index from which to deleteUpdateResponse update(UpdateQuery updateQuery, IndexCoordinates index)
updateQuery
- query defining the updateindex
- the index where to update the records@Deprecated void delete(DeleteQuery query, IndexCoordinates index)
delete(Query, Class, IndexCoordinates)
query
- query defining the objectsindex
- the index where to delete the records@Deprecated @Nullable <T> T get(GetQuery query, Class<T> clazz, IndexCoordinates index)
get(String, Class, IndexCoordinates)
query
- the query defining the id of the object to getclazz
- the type of the object to be returnedindex
- the index from which the object is read.@Deprecated @Nullable <T> T queryForObject(GetQuery query, Class<T> clazz)
get(String, Class, IndexCoordinates)
query
- the query defining the id of the object to getclazz
- the type of the object to be returnedCopyright © 2011–2021 Pivotal Software, Inc.. All rights reserved.