Update README.md

This commit is contained in:
Mohsin Husen 2013-04-10 10:52:51 +02:00
parent c471774e0a
commit 3fd3286386

View File

@ -57,6 +57,12 @@ Extending ElasticsearchRepository for custom methods
```java
public interface BookRepository extends Repository<Book, String> {
//Equivalent Json Query will be "{ "bool" : { "must" :[{ "field" : {"name" : "?"} },{ "field" : {"price" : "?"} }]} }"
List<Book>; findByNameAndPrice(String name, Integer price);
//Equivalent Json Query will be "{"bool" : {"should" : [ {"field" : "name" : "?"}}, {"field" : {"price" : "?"}} ]}}"
List<Book> findByNameOrPrice(String name, Integer price);
//Equivalent Json Query will be "{"bool" : {"must" : {"field" : {"name" : "?"}}}}"
Page<Book> findByName(String name,Pageable page);