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 |
deleteAllById(Iterable<? extends ID> ids) |
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() |
org.springframework.data.domain.Page<T> |
findAll(org.springframework.data.domain.Pageable pageable) |
Iterable<T> |
findAll(org.springframework.data.domain.Sort sort) |
Iterable<T> |
findAllById(Iterable<ID> ids) |
Optional<T> |
findById(ID id) |
<S extends T> |
save(List<S> entities) |
<S extends T> |
save(S entity) |
<S extends T> |
saveAll(Iterable<S> entities) |
org.springframework.data.domain.Page<T> |
searchSimilar(T entity,
String[] fields,
org.springframework.data.domain.Pageable pageable)
Search for similar entities using a morelikethis query
|
protected String |
stringIdRepresentation(ID id) |
protected ElasticsearchOperations operations
protected IndexOperations indexOperations
protected ElasticsearchEntityInformation<T,ID> entityInformation
public SimpleElasticsearchRepository(ElasticsearchEntityInformation<T,ID> metadata, ElasticsearchOperations operations)
public org.springframework.data.domain.Page<T> findAll(org.springframework.data.domain.Pageable pageable)
public long count()
public <S extends T> S save(S entity)
public boolean existsById(ID id)
public org.springframework.data.domain.Page<T> searchSimilar(T entity, @Nullable String[] fields, org.springframework.data.domain.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)
public void delete(T entity)
public void deleteAll()
@Nullable public <R> R execute(SimpleElasticsearchRepository.OperationsCallback<R> callback)
@Nullable public <R> R executeAndRefresh(SimpleElasticsearchRepository.OperationsCallback<R> callback)
Copyright © 2011–2023 Pivotal Software, Inc.. All rights reserved.