There is no option to parse a json query into its builder representation. Why do you want to do it? If you want to hack the query a bit (maybe add a filter, or something similar), then parse the json into a "Map of Maps", add what you need, and add the query as a map (automatically converted to a json) to the search request.
On Tuesday, January 18, 2011 at 4:00 PM, srrIN wrote:
Hi
I need to parse a Json query to booleanquerybuilder. But I am not sure how
to achieve this via Java api.
For e.g
{ "bool" : { "must" : { "term" : { "author": "xyz" } } ,"must" : {
"has_child" : {"type" : "person", "query" :{ "term" : { "name": "abc" } }} }
,"must" : { "has_child" : {"type" : "county", "query" :{ "term" : { "city":
"ny" } }} } } }
I need to parse the above json query to BooleanQueryBuilder. Can anyone help
me how to achieve this?
Thanks in advance.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.