# Java API: Using not analyzed fields

**URL:** https://discuss.elastic.co/t/java-api-using-not-analyzed-fields/15683
**Category:** Elasticsearch
**Created:** [February 8, 2014, 9:28pm UTC](https://discuss.elastic.co/t/java-api-using-not-analyzed-fields/15683 "2014-02-08T21:28:18Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Ryan\_Chazen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ryan_chazen/32/1670_2.png) [@Ryan\_Chazen](https://discuss.elastic.co/u/Ryan_Chazen)
#### Post date: [February 8, 2014, 9:28pm UTC](https://discuss.elastic.co/t/java-api-using-not-analyzed-fields/15683/1 "2014-02-08T21:28:18Z")

</div>

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](mailto: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](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](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [July 6, 2017, 1:51am UTC](https://discuss.elastic.co/t/java-api-using-not-analyzed-fields/15683/2 "2017-07-06T01:51:34Z")

</div>


