Interface DocumentOperations
- All Known Subinterfaces:
MeilisearchOperations
- All Known Implementing Classes:
MeilisearchTemplate
public interface DocumentOperations
The operations for the Documents API.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanDeletes all entities of the given type with the given document ids.booleanDeletes the entity with the given document id.<T> booleanDeletes the given entities.<T> booleandelete(T entity) Deletes a given entity.booleanDeletes all entities of the given type.booleanChecks whether an entity with the given document id exists.<T> TRetrieves an entity by its document id.<T> List<T>Retrieves all entities of the given type.<T> List<T>Retrieves all entities of the given type with the given offset and limit.<T> List<T>Retrieves all entities of the given type with the given document ids.<T> List<T>Retrieves all entities of the given type with the given document ids and offset and limit.<T> List<T>Saves all given entities.<T> Tsave(T entity) Saves an entity.
-
Method Details
-
save
<T> T save(T entity) Saves an entity.- Type Parameters:
T- the type of the entity- Parameters:
entity- the entity to save- Returns:
- the saved entity
-
save
Saves all given entities.- Type Parameters:
T- the type of the entity- Parameters:
entities- the entities to save- Returns:
- the saved entities as list
-
get
Retrieves an entity by its document id.- Type Parameters:
T- the type of the entity- Parameters:
documentId- the document id of the entityclazz- the entity class, must be annotated withDocument- Returns:
- the entity with the given document id or null if none found
-
multiGet
Retrieves all entities of the given type.- Type Parameters:
T- the type of the entity- Parameters:
clazz- the entity class, must be annotated withDocument- Returns:
- all entities
-
multiGet
Retrieves all entities of the given type with the given offset and limit.- Type Parameters:
T- entity type- Parameters:
clazz- must not be null.offset- must not be null.limit- must not be null.- Returns:
- entities
-
multiGet
Retrieves all entities of the given type with the given document ids.- Type Parameters:
T- the type of the entity- Parameters:
documentIds- the document ids of the entitiesclazz- the entity class, must be annotated withDocument- Returns:
- all entities with the given document ids
-
multiGet
Retrieves all entities of the given type with the given document ids and offset and limit.- Type Parameters:
T- entity type- Parameters:
clazz- must not be null.documentIds- must not be null.offset- must not be null.limit- must not be null.- Returns:
- entities
-
exists
Checks whether an entity with the given document id exists.- Parameters:
documentId- the document id of the entityclazz- the entity class, must be annotated withDocument- Returns:
- true if an entity with the given document id exists
-
delete
Deletes the entity with the given document id.- Parameters:
documentId- the document id of the entityclazz- the entity class, must be annotated withDocument- Returns:
- true if an entity was deleted
-
delete
<T> boolean delete(T entity) Deletes a given entity.- Type Parameters:
T- the type of the entity- Parameters:
entity- the entity to delete- Returns:
- true if an entity was deleted
-
delete
Deletes all entities of the given type with the given document ids.- Parameters:
clazz- the entity class, must be annotated withDocumentdocumentIds- the document ids of the entities- Returns:
- true if all entities were deleted
-
delete
Deletes the given entities.- Type Parameters:
T- the type of the entity- Parameters:
entities- the entities to delete- Returns:
- true if all entities were deleted
-
deleteAll
Deletes all entities of the given type.- Parameters:
clazz- the entity class, must be annotated withDocument- Returns:
- true if all entities were deleted
-