public class SimpleElasticsearchRepository<T,ID> extends Object implements ElasticsearchRepository<T,ID>
ElasticsearchRepositoryFactory| Modifier and Type | Class and Description |
|---|---|
static interface |
SimpleElasticsearchRepository.OperationsCallback<R> |
| Modifier and Type | Field and Description |
|---|---|
protected Class<T> |
entityClass |
protected ElasticsearchEntityInformation<T,ID> |
entityInformation |
protected IndexOperations |
indexOperations |
protected ElasticsearchOperations |
operations |
| Constructor and Description |
|---|
SimpleElasticsearchRepository(ElasticsearchEntityInformation<T,ID> metadata,
ElasticsearchOperations operations) |
| Modifier and Type | Method and Description |
|---|---|
long |
count() |
void |
delete(T entity) |
void |
deleteAll() |
void |
deleteAll(Iterable<? extends T> entities) |
void |
deleteById(ID id) |
<R> R |
execute(SimpleElasticsearchRepository.OperationsCallback<R> callback) |
<R> R |
executeAndRefresh(SimpleElasticsearchRepository.OperationsCallback<R> callback) |
boolean |
existsById(ID id) |
protected ID |
extractIdFromBean(T entity) |
Iterable<T> |
findAll() |
Page<T> |
findAll(Pageable pageable) |
Iterable<T> |
findAll(Sort sort) |
Iterable<T> |
findAllById(Iterable<ID> ids) |
Optional<T> |
findById(ID id) |
<S extends T> |
indexWithoutRefresh(S entity)
Deprecated.
|
void |
refresh() |
<S extends T> |
save(List<S> entities) |
<S extends T> |
save(S entity) |
<S extends T> |
saveAll(Iterable<S> entities) |
Page<T> |
search(Query query) |
Iterable<T> |
search(org.elasticsearch.index.query.QueryBuilder query) |
Page<T> |
search(org.elasticsearch.index.query.QueryBuilder query,
Pageable pageable) |
Page<T> |
searchSimilar(T entity,
String[] fields,
Pageable pageable)
Search for similar entities using a morelikethis query
|
protected String |
stringIdRepresentation(ID id) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitindexprotected ElasticsearchOperations operations
protected IndexOperations indexOperations
protected ElasticsearchEntityInformation<T,ID> entityInformation
public SimpleElasticsearchRepository(ElasticsearchEntityInformation<T,ID> metadata, ElasticsearchOperations operations)
public Optional<T> findById(ID id)
findById in interface CrudRepository<T,ID>public Page<T> findAll(Pageable pageable)
findAll in interface PagingAndSortingRepository<T,ID>public Iterable<T> findAll(Sort sort)
findAll in interface PagingAndSortingRepository<T,ID>public Iterable<T> findAllById(Iterable<ID> ids)
findAllById in interface CrudRepository<T,ID>public long count()
count in interface CrudRepository<T,ID>public <S extends T> S save(S entity)
save in interface CrudRepository<T,ID>@Deprecated public <S extends T> S indexWithoutRefresh(S entity)
ElasticsearchRepositoryCrudRepository.saveAll(Iterable). This might lead to a temporary inconsistent state until ElasticsearchRepository.refresh() is
called.indexWithoutRefresh in interface ElasticsearchRepository<T,ID>public <S extends T> Iterable<S> saveAll(Iterable<S> entities)
saveAll in interface CrudRepository<T,ID>public boolean existsById(ID id)
existsById in interface CrudRepository<T,ID>public Iterable<T> search(org.elasticsearch.index.query.QueryBuilder query)
search in interface ElasticsearchRepository<T,ID>public Page<T> search(org.elasticsearch.index.query.QueryBuilder query, Pageable pageable)
search in interface ElasticsearchRepository<T,ID>public Page<T> search(Query query)
search in interface ElasticsearchRepository<T,ID>public Page<T> searchSimilar(T entity, @Nullable String[] fields, Pageable pageable)
ElasticsearchRepositorysearchSimilar in interface ElasticsearchRepository<T,ID>entity - the entity for which similar documents should be searched, must not be nullpageable - , must not be nullpublic void deleteById(ID id)
deleteById in interface CrudRepository<T,ID>public void delete(T entity)
delete in interface CrudRepository<T,ID>public void deleteAll(Iterable<? extends T> entities)
deleteAll in interface CrudRepository<T,ID>public void deleteAll()
deleteAll in interface CrudRepository<T,ID>public void refresh()
refresh in interface ElasticsearchRepository<T,ID>@Nullable public <R> R execute(SimpleElasticsearchRepository.OperationsCallback<R> callback)
@Nullable public <R> R executeAndRefresh(SimpleElasticsearchRepository.OperationsCallback<R> callback)
Copyright © 2011–2021 Pivotal Software, Inc.. All rights reserved.