Java API: Using not analyzed fields


I'm inserting some documents using

Map<String, Object> map = new HashMap<>();
map.put("field1", "something");
getGDS().getClient().prepareIndex("a", "a").setSource(map).get();

This inserts field1 as a text field with an analyzed index, but it's not
actually text, just a string id or other data field. This is inside an ORM,
so I'd like to have it set to use a not analyzed index automatically on
I can't seem to find anything in the API for defining the mapping when
indexing. Have I missed something?

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
To view this discussion on the web visit
For more options, visit