Use ElasticSearch API to provide json filter

I am having requirement where in I need to use filter specified in json
through elasticsearch Java API.

for example below elasticsearch json filter needs to be used through Java
API:
"filter" : {
"bool" : {
"should" : [
{ "term" : {"productID" : "KDKE-B-9947-#kL5"}},
{ "bool" : {
"must" : [
{ "term" : {"productID" : "JODL-X-1937-#pV7"}},
{ "term" : {"price" : 30}}
]
}}
]
}
}

I have explored SearchRequestBuilder.setExtraSource and
SearchRequestBuilder.setSearchType but they do not solve the above issue.
How would I go about it?

Thanks.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/fa5ffb7c-f6f4-474a-80c0-2c0e67a81b5b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.