Code to reproduce the exception:
@Test
public void testESIndex() throws Exception {
String json = "{" +
"\"user\":[0, {\"x\":1}]" +
"}";
Client client = new TransportClient()
.addTransportAddress(new InetSocketTransportAddress(
"localhost", 9300));
IndexResponse indexResponse = index(client, "a", "y", "{\"x\":" + json +
"}");
logger.info(indexResponseToString(indexResponse));
client.close();
}
public static IndexResponse index(Client client, String index, String
type, String json) {
IndexResponse actionGet = client.prepareIndex(index, type)
.setSource(json).execute().actionGet();
return actionGet;
}
public static String indexResponseToString(IndexResponse actionGet) {
return actionGet.getIndex() + "/" + actionGet.getType() + "/"
+ actionGet.getId() + " isCreated: " + actionGet.isCreated();
}
--
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/1b558488-1064-4056-b666-25e6226fdd66%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.