# Unknown setting \[index.tokenizer.name\_tokenizer.max\_gram\]

**URL:** <https://discuss.elastic.co/t/unknown-setting-index-tokenizer-name-tokenizer-max-gram/178098>\
**Category:** Elasticsearch\
**Created:** [April 23, 2019, 7:01pm UTC](https://discuss.elastic.co/t/unknown-setting-index-tokenizer-name-tokenizer-max-gram/178098 "2019-04-23T19:01:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mertyildiran](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mertyildiran/32/44666_2.png) [@mertyildiran](https://discuss.elastic.co/u/mertyildiran)\
**Post date:** [April 23, 2019, 7:01pm UTC](https://discuss.elastic.co/t/unknown-setting-index-tokenizer-name-tokenizer-max-gram/178098/1 "2019-04-23T19:01:50Z")

</div>

This is my [babenkoivan/scout-elasticsearch-driver](https://github.com/babenkoivan/scout-elasticsearch-driver) configuration:

```php
<?php

namespace App;

use ScoutElastic\IndexConfigurator;
use ScoutElastic\Migratable;

class PersonIndexConfigurator extends IndexConfigurator
{
    use Migratable;

    /**
     * @var array
     */
    protected $settings = [
        'analysis' => [
            'analyzer' => [
                'name_analyzer' => [
                    'tokenizer' => 'name_tokenizer'
                ]
            ]
        ],
        'tokenizer' => [
            'name_tokenizer' => [
                'type' => 'edge_ngram',
                'min_gram' => 1,
                'max_gram' => 10,
                'token_chars' => [
                    'letter',
                    'digit'
                ]
            ]
        ]
    ];
}

```

when I try to create an index I get this error:

```nohighlight
 Elasticsearch\Common\Exceptions\BadRequest400Exception : {"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"unknown setting [index.tokenizer.name_tokenizer.max_gram] please check that 
 any required plugins are installed, or check the breaking changes documentation for removed settings"}],"type":"illegal_argument_exception","reason":"unknown setting [index.tokenizer.name_tokenizer.max_gram] 
 please check that any required plugins are installed, or check the breaking changes documentation for removed settings","suppressed":[{"type":"illegal_argument_exception","reason":"unknown setting 
 [index.tokenizer.name_tokenizer.min_gram] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"},{"type":"illegal_argument_exception","reason":
 "unknown setting [index.tokenizer.name_tokenizer.token_chars] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"},{"type":"illegal_argument_exception",
 "reason":"unknown setting [index.tokenizer.name_tokenizer.type] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"}]},"status":400}

```

What is wrong with my configuration/mapping?

I have followed this documentation by the way:  
[https://www.elastic.co/guide/en/elasticsearch/reference/6.4/analysis-edgengram-tokenizer.html#\_example\_configuration\_10](https://www.elastic.co/guide/en/elasticsearch/reference/6.4/analysis-edgengram-tokenizer.html#_example_configuration_10)

---

<div class="post-metadata">

**Author:** ![mertyildiran](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mertyildiran/32/44666_2.png) [@mertyildiran](https://discuss.elastic.co/u/mertyildiran)\
**Post date:** [April 23, 2019, 8:47pm UTC](https://discuss.elastic.co/t/unknown-setting-index-tokenizer-name-tokenizer-max-gram/178098/2 "2019-04-23T20:47:55Z")

</div>

I realized my mistake; I misplaced 'tokenizer' to wrong level. It should have been placed under 'analysis' not sibling to. Such a silly mistake for me 🙂

The correct version:

```php
<?php

namespace App;

use ScoutElastic\IndexConfigurator;
use ScoutElastic\Migratable;

class PersonIndexConfigurator extends IndexConfigurator
{
    use Migratable;

    /**
     * @var array
     */
    protected $settings = [
        'analysis' => [
            'analyzer' => [
                'name_analyzer' => [
                    'tokenizer' => 'name_tokenizer'
                ]
            ],
            'tokenizer' => [
                'name_tokenizer' => [
                    'type' => 'edge_ngram',
                    'min_gram' => 1,
                    'max_gram' => 10,
                    'token_chars' => [
                        'letter',
                        'digit'
                    ]
                ]
            ]
        ]
    ];
}

```

---

<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 21, 2019, 8:47pm UTC](https://discuss.elastic.co/t/unknown-setting-index-tokenizer-name-tokenizer-max-gram/178098/3 "2019-05-21T20:47:57Z")

</div>

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