Java API: Using not analyzed fields


(Ryan Chazen) #1

Hey

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
index.
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 elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/359f9fcc-dbd0-4f06-995f-d4b9a4da9862%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(system) #2