Hey, can you check the update response, if it was successful? Usually a refresh should be sufficient? You are testing the REST API while you are running this test and the REST works and this test doesnt?
Also can you provide a complete snippet including indexation and all your calls? The above code doesnt compile and contains many placeholders, so we cannot a complete picture of what you are doing.. A gist would be great! Thanks! --Alex On Sat, Jan 11, 2014 at 1:07 PM, Ukyo Virgden <[email protected]> wrote: > Hi, > > I've just updated to 0.90.10 from 0.90.5, and I'm having some issues with > my unit tests. > > Here's the outline of the test > > TransportClient c = new TransportClient(settings).addTransportAddress(new > InetSocketTransportAddress("localhost", 9300)); > SearchResponse res = c.prepareSearch().setIndices(TEST_INDEX).addFields( > LIST_OF_FIELDS).setQuery(QueryBuilders.matchQuery("id", "<<SOME ID>>")). > execute().actionGet(); > // do the update > UpdateResponse updateRes = prepareUpdateRequestForDocument(indexName,document > ).setScript("<< UPDATE SCRIPT >>").execute().actionGet(); > > // via REST API, I see the modified document hence the update is applied. > // sleep for a while and repeat search > SearchResponse res = c.prepareSearch().setIndices(TEST_INDEX).addFields( > LIST_OF_FIELDS).setQuery(QueryBuilders.matchQuery("id", "<<SOME ID>>")). > execute().actionGet(); > > SearchHit hit = res.getHits().getAt(0); > // the document returned in the second search is not the updated document. > assert(check document) -> fails > > > > even if I issue > > client.admin().indices().prepareRefresh(TEST_INDEX).execute().actionGet(); > > > or > > client.admin().indices().prepareFlush(TEST_INDEX).execute().actionGet(); > > > Why am I receiving the non-updated old document from the Java API where I > immediately see the updated document via rest api? What am I missing? > > Thanks in advance, > Ukyo > > -- > 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 [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/elasticsearch/71df3e92-cc2d-4b03-acd1-73330e7df914%40googlegroups.com > . > For more options, visit https://groups.google.com/groups/opt_out. > -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAGCwEM_0jF9XA0%3DgRs3%2BCaqLKyed%2BBFX0-y_Ysj5Lh5UaQBZ-A%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
