0

There are lot of examples for findBy prefix but i couldn't find any example or document for how to use get prefix with method name to get the all 'address' fields from solr. This is my Dao class

@Repository
public interface CarDao extends SolrCrudRepository<House,String> {

    Page<CarModel>findByNameContainsIgnoreCaseAndConditionAndCountry(String name,String condition,String country, Pageable pageable);


    List<String> getAddress();
}

Any help ?

1 Answers1

1

You can use fields attribute in @Query annotation on getAddress method to get the required fields.

@Query(fields={"address"}, value="YOUR_QUERY")
List<String> getAddress();
sidgate
  • 14,650
  • 11
  • 68
  • 119