Re: Count not working for Java API, works for REST

2014-06-23 Thread Matt Chambers
Fixed that one by parsing the json as Map rather than a string. On Tuesday, June 24, 2014 7:41:42 AM UTC+12, Matt Chambers wrote: > > I think get() is just a shortcut for execute().actionGet() > > Anyway, problem solved, it was a problem with my mapping not applying > correctly with the Java AP

Re: Count not working for Java API, works for REST

2014-06-23 Thread Matt Chambers
I think get() is just a shortcut for execute().actionGet() Anyway, problem solved, it was a problem with my mapping not applying correctly with the Java API. Looking into that now. I'm doing this at the start of the tests to apply the mapping, but its not being applied. client.ad

Re: Count not working for Java API, works for REST

2014-06-23 Thread Brian
Perhaps you need to insert the execute().actionGet() method calls, as below? CountRequestBuilder builder = client.prepareCount(indexName) .setTypes("product") .setQuery(getQuery(req)); *builder.execute().actionGet()* return builder.get().getCount(); I don't use Count, but I have used Query and

Count not working for Java API, works for REST

2014-06-23 Thread Matt Chambers
Kind of a strange situation. I've tried 1.0.3, 1.1.2, and 1.2.1, all have the same problem (upgraded from .90.13) My query is simple, looks like this: { "filtered" : { "query" : { "match_all" : { } }, "filter" : { "and" : { "filters" : [ { "terms" :