# Create index with custom settings and mappings

**URL:** <https://discuss.elastic.co/t/create-index-with-custom-settings-and-mappings/129148>\
**Category:** Elasticsearch\
**Created:** [April 23, 2018, 4:39pm UTC](https://discuss.elastic.co/t/create-index-with-custom-settings-and-mappings/129148 "2018-04-23T16:39:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maxime\_Lambert](https://avatars.discourse-cdn.com/v4/letter/m/f19dbf/32.png) [@Maxime\_Lambert](https://discuss.elastic.co/u/Maxime_Lambert)\
**Post date:** [April 23, 2018, 4:39pm UTC](https://discuss.elastic.co/t/create-index-with-custom-settings-and-mappings/129148/1 "2018-04-23T16:39:00Z")

</div>

Hello there,

I try to create an index with custom settings and mappings.

PUT /my\_index

```auto
    {
       "settings": {
           "analysis": {
               "analyzer": {
                   "my_analyzer": {
                       "type": "custom",
                       "char_filter": [
                           "my_char_filter"
                       ],
                       "tokenizer": "whitespace",
                       "filter": ["lowercase"]
                   }
               },
               "char_filter": {
                   "my_char_filter": {
                       "type": "mapping",
                       "mappings": [
                           "a => ٨",
                       ]
                   }
               }
           }
       },
       "mappings": {
           "file": {
               "properties": {
                   "attachment.content": {
                       "type": "text",
                       "analyzer": "my_analyzer" 
                   }
               }
           }
       }
    }

```

I thought that the "attachment.content" would be stored after ElasticSearch replaces "a" into "٨", but it's not the case.  
When I index a document and search for "٨", I don't find anything:  
PUT /my\_index/file/{id}?pipeline=attachment

```auto
    {
       "data": "myencodedbase64data"
    }

```

GET /dv-dm4ep-test/file/\_search

```auto
    {
       "_source": ["attachment.content"], 
       "query":{
          "match_all" : {}
       }
    }

```

As you can see, the "a" characters have not been replaced by "٨":

```auto
    {
       "took": 17,
       "timed_out": false,
       "_shards": {
          "total": 5,
          "successful": 5,
          "skipped": 0,
          "failed": 0
       },
       "hits": {
          "total": 1718,
          "max_score": 1,
          "hits": [
             {
                "_index": "my_index",
                "_type": "file",
                "_id": "32215",
                "_score": 1,
                "_source": {
                   "attachment": {
                      "content": """01 Legislative reports"""
                   }
                }
             },
             {...}
          ]
       }
    }

```

Any help is welcome!  
Thanks

---

<div class="post-metadata">

**Author:** ![Maxime\_Lambert](https://avatars.discourse-cdn.com/v4/letter/m/f19dbf/32.png) [@Maxime\_Lambert](https://discuss.elastic.co/u/Maxime_Lambert)\
**Post date:** [April 24, 2018, 3:46pm UTC](https://discuss.elastic.co/t/create-index-with-custom-settings-and-mappings/129148/3 "2018-04-24T15:46:20Z")

</div>

Moreover, when I do "GET /my\_index/\_mapping\_file", I get:

```auto
{
  "my_index": {
    "mappings": {
      "file": {
        "properties": {
          "attachment": {
            "properties": {
              "content": {
                "type": "text",
                "fields": {
                  "keyword": {
                    "type": "keyword",
                    "ignore_above": 256
                  }
                }
              },
              ...
            }
          }
        }
      }
    }
  }
}

```

I don't see any reference to my custom analyzer here... Any idea please?

---

<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:** [May 22, 2018, 3:46pm UTC](https://discuss.elastic.co/t/create-index-with-custom-settings-and-mappings/129148/4 "2018-05-22T15:46:22Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
