Class SimpleElasticsearchRepository<T,ID>
java.lang.Object
org.springframework.data.elasticsearch.repository.support.SimpleElasticsearchRepository<T,ID>
- All Implemented Interfaces:
ElasticsearchRepository<T,
,ID> CrudRepository<T,
,ID> PagingAndSortingRepository<T,
,ID> Repository<T,
ID>
public class SimpleElasticsearchRepository<T,ID>
extends Object
implements ElasticsearchRepository<T,ID>
Elasticsearch specific repository implementation. Likely to be used as target within
ElasticsearchRepositoryFactory
- Author:
- Rizwan Idrees, Mohsin Husen, Ryan Henszey, Kevin Leturc, Mark Paluch, Christoph Strobl, Michael Wirth, Sascha Woo, Murali Chevuri, Peter-Josef Meisch, Aleksei Arsenev, Jens Schauder
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
-
Field Summary
Modifier and TypeFieldDescriptionprotected ElasticsearchEntityInformation<T,
ID> protected IndexOperations
protected ElasticsearchOperations
-
Constructor Summary
ConstructorDescriptionSimpleElasticsearchRepository
(ElasticsearchEntityInformation<T, ID> metadata, ElasticsearchOperations operations) -
Method Summary
Modifier and TypeMethodDescriptionlong
count()
void
void
void
void
deleteAllById
(Iterable<? extends ID> ids) void
deleteById
(ID id) <R> R
execute
(SimpleElasticsearchRepository.OperationsCallback<R> callback) <R> R
boolean
existsById
(ID id) protected ID
extractIdFromBean
(T entity) findAll()
findAllById
(Iterable<ID> ids) <S extends T>
Ssave
(S entity) searchSimilar
(T entity, String[] fields, Pageable pageable) Search for similar entities using a morelikethis queryprotected String
-
Field Details
-
operations
-
indexOperations
-
entityClass
-
entityInformation
-
-
Constructor Details
-
SimpleElasticsearchRepository
public SimpleElasticsearchRepository(ElasticsearchEntityInformation<T, ID> metadata, ElasticsearchOperations operations)
-
-
Method Details
-
findById
- Specified by:
findById
in interfaceCrudRepository<T,
ID>
-
findAll
- Specified by:
findAll
in interfaceCrudRepository<T,
ID>
-
findAll
- Specified by:
findAll
in interfacePagingAndSortingRepository<T,
ID>
-
findAll
- Specified by:
findAll
in interfacePagingAndSortingRepository<T,
ID>
-
findAllById
- Specified by:
findAllById
in interfaceCrudRepository<T,
ID>
-
count
public long count()- Specified by:
count
in interfaceCrudRepository<T,
ID>
-
save
- Specified by:
save
in interfaceCrudRepository<T,
ID>
-
save
-
saveAll
- Specified by:
saveAll
in interfaceCrudRepository<T,
ID>
-
existsById
- Specified by:
existsById
in interfaceCrudRepository<T,
ID>
-
searchSimilar
Description copied from interface:ElasticsearchRepository
Search for similar entities using a morelikethis query- Specified by:
searchSimilar
in interfaceElasticsearchRepository<T,
ID> - Parameters:
entity
- the entity for which similar documents should be searched, must not be nullpageable
- , must not be null- Returns:
-
deleteById
- Specified by:
deleteById
in interfaceCrudRepository<T,
ID>
-
delete
- Specified by:
delete
in interfaceCrudRepository<T,
ID>
-
deleteAllById
- Specified by:
deleteAllById
in interfaceCrudRepository<T,
ID>
-
deleteAll
- Specified by:
deleteAll
in interfaceCrudRepository<T,
ID>
-
deleteAll
public void deleteAll()- Specified by:
deleteAll
in interfaceCrudRepository<T,
ID>
-
extractIdFromBean
-
stringIdRepresentation
-
execute
-
executeAndRefresh
@Nullable public <R> R executeAndRefresh(SimpleElasticsearchRepository.OperationsCallback<R> callback)
-