# Creating index - settings vs mapping

**URL:** <https://discuss.elastic.co/t/creating-index-settings-vs-mapping/59418>\
**Category:** Elasticsearch\
**Created:** [August 31, 2016, 11:13am UTC](https://discuss.elastic.co/t/creating-index-settings-vs-mapping/59418 "2016-08-31T11:13:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![uncleBens](https://avatars.discourse-cdn.com/v4/letter/u/a9a28c/32.png) [@uncleBens](https://discuss.elastic.co/u/uncleBens)\
**Post date:** [August 31, 2016, 11:13am UTC](https://discuss.elastic.co/t/creating-index-settings-vs-mapping/59418/1 "2016-08-31T11:13:39Z")

</div>

Hi,

I want to create index and tell Elasticsearch to index specific fields from my document.

My document is Event (ID,NAME,DESCRIPTION,DATE) and i will put such documents into index.

I want to tell Elasticsearch, that when I search documents it should check NAME and DESCRIPTION fields. I quess I should point NAME an DESCRIPTION fields and their types and index stragegy, for example analyze.

I create index:

> CreateIndexRequestBuilder createIndexRequestBuilder = client.admin().indices().prepareCreate(name).setSettings(???);
> 
> createIndexRequestBuilder.addMapping(???);

What is the difference between settings and mapping and where should I provide the index strategy for NAME and DESCRIPTION?

Also.. where to pass the type of the document that I want to index? For example indexName is provided in prepareCreate(indexName), where documentType should be provided?

---

<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, 10:23pm UTC](https://discuss.elastic.co/t/creating-index-settings-vs-mapping/59418/2 "2017-07-05T22:23:38Z")

</div>

Closed on July 5, 2017, 10:23pm UTC


