prepareIndex() is to index a document. What you want is prepareCreate(). I have an example here (check the method createIndexFullMapping()):
https://github.com/bly2k/es-java-examples/blob/master/admin/IndexAdminExample.java -- 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 elasticsearch+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/ef4c75f2-4f29-4fc2-92ea-79077df54a9c%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.