I'm trying to use the Query / Filter Builder objects with the Java API.
However, when I execute a query using these it is failing. If I take the
JSON output that the Query / Filter Builders generate and run them via the
REST API, the query succeeds. I have no clue how to debug what is going on
here.
The error message I'm getting is:
nested: QueryParsingException[[db_name] Failed to find geo_shape field
[searchGeometry]]
As you can see here, the geo_shape mapping does exist:
For now, I've worked around this by not using the query builders, but by
generating the JSON for queries using XContentBuilder.
On Monday, November 11, 2013 10:22:42 AM UTC-5, Kyle Pinette wrote:
Hey Guys,
I'm trying to use the Query / Filter Builder objects with the Java API.
However, when I execute a query using these it is failing. If I take the
JSON output that the Query / Filter Builders generate and run them via the
REST API, the query succeeds. I have no clue how to debug what is going on
here.
The error message I'm getting is:
nested: QueryParsingException[[db_name] Failed to find geo_shape field
[searchGeometry]]
As you can see here, the geo_shape mapping does exist:
Would be nice to understand what the problem was and fix it. Can you maybe
post the java code that triggers the error?
On Monday, November 11, 2013 6:33:12 PM UTC+1, Kyle Pinette wrote:
For now, I've worked around this by not using the query builders, but by
generating the JSON for queries using XContentBuilder.
On Monday, November 11, 2013 10:22:42 AM UTC-5, Kyle Pinette wrote:
Hey Guys,
I'm trying to use the Query / Filter Builder objects with the Java API.
However, when I execute a query using these it is failing. If I take the
JSON output that the Query / Filter Builders generate and run them via the
REST API, the query succeeds. I have no clue how to debug what is going on
here.
The error message I'm getting is:
nested: QueryParsingException[[db_name] Failed to find geo_shape field
[searchGeometry]]
As you can see here, the geo_shape mapping does exist:
One thing to try in your Java code is to call the toString method of the
top-level QueryBuilder. This creates a pretty-printed JSON string that
matches the Java query.
Brian
On Monday, November 11, 2013 12:33:12 PM UTC-5, Kyle Pinette wrote:
For now, I've worked around this by not using the query builders, but by
generating the JSON for queries using XContentBuilder.
I think the error message I posted was not the correct error message, there
were multiple calls being made and it seems this was an error related to a
different call.
For now, I've changed my code to generate the queries manually using
XContentBuilder and this seems to work fine. If I decide to be brave and
go back to using the QueryBuilders, I'll post a response here.
Thanks,
Kyle
On Wednesday, November 13, 2013 11:01:30 AM UTC-5, InquiringMind wrote:
Hi, Kyle.
One thing to try in your Java code is to call the toString method of the
top-level QueryBuilder. This creates a pretty-printed JSON string that
matches the Java query.
Brian
On Monday, November 11, 2013 12:33:12 PM UTC-5, Kyle Pinette wrote:
For now, I've worked around this by not using the query builders, but by
generating the JSON for queries using XContentBuilder.
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.