ES newbie here. i noticed that typeExists() queries return false after
successful bulk index() but don't understand why. is that expected? Using
java client v 0.90.9. thanks in advance!
non-bulk works:
@Test
public void testTypeExists()
{
assertFalse(admin().indices().prepareTypesExists(INDEX_NAME).setTypes("foo").get().isExists());
assertEquals("foo",
client().prepareIndex().setIndex(INDEX_NAME).setType("foo").setId("1").setSource("{\"a\":\"b\"}").get()
.getType());
assertTrue(admin().indices().prepareTypesExists(INDEX_NAME).setTypes("foo").get().isExists());
//RETURNS TRUE AS EXPECTED
}
bulk fails:
@Test
public void testTypeExistsAfterBulkIndex()
{
assertFalse(admin().indices().prepareTypesExists(INDEX_NAME).setTypes("foo").get().isExists());
assertEquals("foo",
client().prepareBulk().add(client().prepareIndex().setIndex(INDEX_NAME).setType("foo").setId("1")
.setSource("{\"a\":\"b\"}")).execute().actionGet().getItems()[0].getType());
//SUCCEEDS
assertTrue(admin().indices().prepareTypesExists(INDEX_NAME).setTypes("foo").get().isExists());
//FAILS
}
--
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/10d8a7c9-7d4b-4065-a8e5-624fd2750393%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.