add filter setting with clojure in groovy

This commit is contained in:
kimchy 2011-01-28 11:28:41 +02:00
parent ead4d600be
commit 3f8933fb7b
1 changed files with 6 additions and 0 deletions

View File

@ -127,6 +127,12 @@ class GClient {
SearchRequestBuilder.metaClass.query = {Closure c ->
delegate.setQuery(new GXContentBuilder().buildAsBytes(c, contentType))
}
SearchRequestBuilder.metaClass.setFilter = {Closure c ->
delegate.setFilter(new GXContentBuilder().buildAsBytes(c, contentType))
}
SearchRequestBuilder.metaClass.filter = {Closure c ->
delegate.setFilter(new GXContentBuilder().buildAsBytes(c, contentType))
}
MoreLikeThisRequest.metaClass.setSearchSource = {Closure c ->
delegate.searchSource(new GXContentBuilder().buildAsBytes(c, contentType))