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.