简体   繁体   中英

Spring data repository Aggregation

I am using Spring data and have a repository with some data about cars.

My interface:

public interface CarRepository extends ElasticsearchRepository<Car, String> {

    public List<Car> findByYear(int year);

    public List<Car> findByYearGreaterThan(int year);

}

How can I create a method to use faceted search (I believe they are called aggregations on Elasticsearch) on my repo?

最后使用ElasticSearchTemplate很容易(因为它访问相同的索引)。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM