Unsure but your JSON looks incorrect to me. You are trying to send in an array 
a number 0 and an object. 


David

> Le 5 févr. 2015 à 22:53, Vicente de Rivera III <[email protected]> a 
> écrit :
> 
> 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.

-- 
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/626A9565-D5E7-4488-AF36-11F6E15C0D9E%40pilato.fr.
For more options, visit https://groups.google.com/d/optout.

Reply via email to