Use filter specified in json through java API

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}}
]
}}
]
}
}

How would I go about it?

I have written my own builder/converter that achieves the above. But if
there are pre-existing options, then I would look to explore them.

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/563e7855-a2bd-45f9-9ad9-f6c04811996f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Or you could say that I need convert request specified in json format
through java API.

On Wednesday, April 8, 2015 at 3:16:37 PM UTC-7, Prateek Asthana wrote:

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}}
]
}}
]
}
}

How would I go about it?

I have written my own builder/converter that achieves the above. But if
there are pre-existing options, then I would look to explore them.

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/06222ffe-c46b-4a2a-9230-2f8c20d0d0dc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.