Query run via Java API fails

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:

Also, here is the query:

Any help would be much appreciated.

-Kyle

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

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:

curl -XGET http://localhost:9200/new_il_vectordb/layer_0/_mapping · GitHub

Also, here is the query:

es_error_query.json · GitHub

Any help would be much appreciated.

-Kyle

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

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:

curl -XGET http://localhost:9200/new_il_vectordb/layer_0/_mapping · GitHub

Also, here is the query:

es_error_query.json · GitHub

Any help would be much appreciated.

-Kyle

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

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.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

Guys,

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.

--
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.
For more options, visit https://groups.google.com/groups/opt_out.