# Set custom settings for a index

**URL:** <https://discuss.elastic.co/t/set-custom-settings-for-a-index/9799>\
**Category:** Elasticsearch\
**Created:** [November 23, 2012, 2:28am UTC](https://discuss.elastic.co/t/set-custom-settings-for-a-index/9799 "2012-11-23T02:28:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![zkidkid](https://avatars.discourse-cdn.com/v4/letter/z/fbc32d/32.png) [@zkidkid](https://discuss.elastic.co/u/zkidkid)\
**Post date:** [November 23, 2012, 2:28am UTC](https://discuss.elastic.co/t/set-custom-settings-for-a-index/9799/1 "2012-11-23T02:28:48Z")

</div>

Hi  
I have two index, one I use default analyze, other I want set a custom  
analyze to it.

I set up as bellow in config file:

index:  
analysis:  
tokenizer:  
my\_gram:  
type: edgeNGram  
min\_gram: 1  
max\_gram: 50  
analyzer:  
default:  
tokenizer: whitespace  
filter: [lowercase]  
auto:  
type: custom  
tokenizer: my\_gram  
filter: [asciifolding,lowercase]  
_mappings:_

- my\_custom\_index: \*
- 

```
 song_name: *

```

- 

```
   analyzer: auto*

```

- 

```
   index_analyzer: auto*

```

- 

```
   search_analyzer: auto*

```

- 
- 
- 
- 

I have tried to change many kinds of mapping but it dont apply "auto"  
analyze to "my\_custom\_index" or "song\_name" type of "my\_custom\_index".  
ex:  
_mappings:_

- my\_custom\_index: \*
- 

```
   analyzer: auto*

```

- 
- 

....

--

---

<div class="post-metadata">

**Author:** ![zkidkid](https://avatars.discourse-cdn.com/v4/letter/z/fbc32d/32.png) [@zkidkid](https://discuss.elastic.co/u/zkidkid)\
**Post date:** [November 23, 2012, 11:54am UTC](https://discuss.elastic.co/t/set-custom-settings-for-a-index/9799/2 "2012-11-23T11:54:25Z")

</div>

any help ?

On Friday, November 23, 2012 9:28:48 AM UTC+7, kidkid wrote:

> Hi  
> I have two index, one I use default analyze, other I want set a custom  
> analyze to it.
> 
> I set up as bellow in config file:
> 
> index:  
> analysis:  
> tokenizer:  
> my\_gram:  
> type: edgeNGram  
> min\_gram: 1  
> max\_gram: 50  
> analyzer:  
> default:  
> tokenizer: whitespace  
> filter: [lowercase]  
> auto:  
> type: custom  
> tokenizer: my\_gram  
> filter: [asciifolding,lowercase]  
> _mappings:_
> 
> - my\_custom\_index: \*
> - 
> 
> ```
> song_name: *
> 
> ```
> 
> - 
> 
> ```
> analyzer: auto*
> 
> ```
> 
> - 
> 
> ```
> index_analyzer: auto*
> 
> ```
> 
> - 
> 
> ```
> search_analyzer: auto*
> 
> ```
> 
> - 
> - 
> - 
> - 
> 
> I have tried to change many kinds of mapping but it dont apply "auto"  
> analyze to "my\_custom\_index" or "song\_name" type of "my\_custom\_index".  
> ex:  
> _mappings:_
> 
> - my\_custom\_index: \*
> - 
> 
> ```
> analyzer: auto*
> 
> ```
> 
> - 
> - 
> 
> ....

--

---

<div class="post-metadata">

**Author:** ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)\
**Post date:** [November 24, 2012, 1:56am UTC](https://discuss.elastic.co/t/set-custom-settings-for-a-index/9799/3 "2012-11-24T01:56:48Z")

</div>

You can specify both the analyzer and mappings when you create the second  
index using Index Create API:

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

curl -XPUT localhost:9200/my\_custom\_index -d '{  
"settings": {  
"index": {  
"analysis": {  
"tokenizer": {  
"my\_gram": {  
"type": "edgeNGram",  
"min\_gram": 1,  
"max\_gram": 50  
}  
},  
"analyzer": {  
"default": {  
"tokenizer": "whitespace",  
"filter": ["lowercase"]  
},  
"auto": {  
"type": "custom",  
"tokenizer": "my\_gram",  
"filter": ["asciifolding", "lowercase"]  
}  
}  
}  
}  
},  
"mappings": {  
"my\_type": {  
"properties": {  
"song\_name": {  
"type": "string",  
"analyzer": "auto"  
}  
}  
}  
}  
}'

Alternatively, you can store your mapping in a file and put in  
config/mappings/[index\_name]  
directory [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/mapping/conf-mappings.html)

On Friday, November 23, 2012 6:54:25 AM UTC-5, kidkid wrote:

> any help ?
> 
> On Friday, November 23, 2012 9:28:48 AM UTC+7, kidkid wrote:
> 
> > Hi  
> > I have two index, one I use default analyze, other I want set a custom  
> > analyze to it.
> > 
> > I set up as bellow in config file:
> > 
> > index:  
> > analysis:  
> > tokenizer:  
> > my\_gram:  
> > type: edgeNGram  
> > min\_gram: 1  
> > max\_gram: 50  
> > analyzer:  
> > default:  
> > tokenizer: whitespace  
> > filter: [lowercase]  
> > auto:  
> > type: custom  
> > tokenizer: my\_gram  
> > filter: [asciifolding,lowercase]  
> > _mappings:_
> > 
> > - my\_custom\_index: \*
> > - 
> > 
> > ```
> > song_name: *
> > 
> > ```
> > 
> > - 
> > 
> > ```
> > analyzer: auto*
> > 
> > ```
> > 
> > - 
> > 
> > ```
> > index_analyzer: auto*
> > 
> > ```
> > 
> > - 
> > 
> > ```
> > search_analyzer: auto*
> > 
> > ```
> > 
> > - 
> > - 
> > - 
> > - 
> > 
> > I have tried to change many kinds of mapping but it dont apply "auto"  
> > analyze to "my\_custom\_index" or "song\_name" type of "my\_custom\_index".  
> > ex:  
> > _mappings:_
> > 
> > - my\_custom\_index: \*
> > - 
> > 
> > ```
> > analyzer: auto*
> > 
> > ```
> > 
> > - 
> > - 
> > 
> > ....

--

---

<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, 3:03am UTC](https://discuss.elastic.co/t/set-custom-settings-for-a-index/9799/4 "2017-07-06T03:03:04Z")

</div>


