# Indexing data with java api but the field not indexed

**URL:** <https://discuss.elastic.co/t/indexing-data-with-java-api-but-the-field-not-indexed/37533>\
**Category:** Elasticsearch\
**Created:** [December 18, 2015, 4:06am UTC](https://discuss.elastic.co/t/indexing-data-with-java-api-but-the-field-not-indexed/37533 "2015-12-18T04:06:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sunqi\_sunny](https://avatars.discourse-cdn.com/v4/letter/s/7ab992/32.png) [@sunqi\_sunny](https://discuss.elastic.co/u/sunqi_sunny)\
**Post date:** [December 18, 2015, 4:06am UTC](https://discuss.elastic.co/t/indexing-data-with-java-api-but-the-field-not-indexed/37533/1 "2015-12-18T04:06:24Z")

</div>

I indexed data with java api like:  
`response = client.prepareIndex(IndexName, TypeName).setSource(jsonBuilder().startObject() .field("age", face.getAge()) .field("gender", face.getGender()) .field("height",face.getHeight()) .field("fat",face.getFat()) .field("date", face.getDate()).endObject()) .get(); ret = response.isCreated();`  
and it works,I can see my data in Kibana,but I can not search any field because every field has a 'not indexed' tag.  
what can I do

---

<div class="post-metadata">

**Author:** ![dabing](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dabing/32/6713_2.png) [@dabing](https://discuss.elastic.co/u/dabing)\
**Post date:** [December 18, 2015, 4:30am UTC](https://discuss.elastic.co/t/indexing-data-with-java-api-but-the-field-not-indexed/37533/2 "2015-12-18T04:30:19Z")

</div>

you need config es mapping?

---

<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 5, 2017, 11:30pm UTC](https://discuss.elastic.co/t/indexing-data-with-java-api-but-the-field-not-indexed/37533/3 "2017-07-05T23:30:02Z")

</div>


