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 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.admin().indices().prepareCreate(indexName).addMapping("product", 
> mappingJson).execute().actionGet();
> -Matt
>
> On Tuesday, June 24, 2014 6:35:32 AM UTC+12, Brian wrote:
>>
>> 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 Update and Delete and they 
>> all work similarly in this regard. Just a guess.
>>
>> Brian
>>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/95d8d82e-e154-4483-b005-570f3166f362%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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.admin().indices().prepareCreate(indexName).addMapping("product", 
mappingJson).execute().actionGet();
-Matt

On Tuesday, June 24, 2014 6:35:32 AM UTC+12, Brian wrote:
>
> 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 Update and Delete and they 
> all work similarly in this regard. Just a guess.
>
> Brian
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/5c121d44-81df-4b1f-bdeb-a2fe6ab9ed5c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 Update and Delete and they all 
work similarly in this regard. Just a guess.

Brian

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/efaf68b8-90f1-47c7-87c1-d124ae7c4bce%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.