# Using word\_delimiter with edgeNGram ignores Word\_Delimiter Token

**URL:** <https://discuss.elastic.co/t/using-word-delimiter-with-edgengram-ignores-word-delimiter-token/43660>\
**Category:** Elasticsearch\
**Created:** [March 7, 2016, 2:24pm UTC](https://discuss.elastic.co/t/using-word-delimiter-with-edgengram-ignores-word-delimiter-token/43660 "2016-03-07T14:24:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![batmaci](https://avatars.discourse-cdn.com/v4/letter/b/f08c70/32.png) [@batmaci](https://discuss.elastic.co/u/batmaci)\
**Post date:** [March 7, 2016, 2:24pm UTC](https://discuss.elastic.co/t/using-word-delimiter-with-edgengram-ignores-word-delimiter-token/43660/1 "2016-03-07T14:24:03Z")

</div>

I have my custom analyzer as below. But I dont understand how to achieve my goal.

My goal is that I want to have whitespace separated inverted index but also I want to have autocomplete feature after user enters min 3 chars. For that I though to combine word\_delimiter and edgeNGram tokens as below

```
{
  "settings": {
    "index": {
      "analysis": {
        "analyzer": {
          "my_analyzer": {
            "tokenizer": "whitespace",
            "filter": [
              "standard",
              "lowercase",
              "my_word_delimiter",
              "my_edge_ngram_analyzer"
            ],
            "type": "custom"
          }
        },
        "filter": {
          "my_word_delimiter": {
            "catenate_all": true,
            "type": "word_delimiter"
          },
          "my_edge_ngram_analyzer": {
            "min_gram": 3,
            "max_gram": 10,
            "type": "edgeNGram"
          }
        }
      }
    }
  }
}

```

This will give result for "Brother TN-200" as below. But I was expecting "tn" to be also in the reverted index as I have word\_delimiter token. why is it not in the inverted index? How can I achieve this?

```
url -XGET "localhost:9200/myIndex/_analyze?analyzer=my_analyzer&pr
    etty=true" -d "Brother TN-200"
    {
      {
        "token" : "bro",
        "start_offset" : 14,
        "end_offset" : 21,
        "type" : "word",
        "position" : 2
      }, {
        "token" : "brot",
        "start_offset" : 14,
        "end_offset" : 21,
        "type" : "word",
        "position" : 2
      }, {
        "token" : "broth",
        "start_offset" : 14,
        "end_offset" : 21,
        "type" : "word",
        "position" : 2
      }, {
        "token" : "brothe",
        "start_offset" : 14,
        "end_offset" : 21,
        "type" : "word",
        "position" : 2
      }, {
        "token" : "brother",
        "start_offset" : 14,
        "end_offset" : 21,
        "type" : "word",
        "position" : 2
      }, {
        "token" : "tn2",
        "start_offset" : 22,
        "end_offset" : 28,
        "type" : "word",
        "position" : 3
      }, {
        "token" : "tn20",
        "start_offset" : 22,
        "end_offset" : 28,
        "type" : "word",
        "position" : 3
      }, {
        "token" : "tn200",
        "start_offset" : 22,
        "end_offset" : 28,
        "type" : "word",
        "position" : 3
      }, {
        "token" : "200",
        "start_offset" : 25,
        "end_offset" : 28,
        "type" : "word",
        "position" : 4
      }]
    }
```

---

<div class="post-metadata">

**Author:** ![jpountz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jpountz/32/45836_2.png) [@jpountz](https://discuss.elastic.co/u/jpountz)\
**Post date:** [March 8, 2016, 1:25pm UTC](https://discuss.elastic.co/t/using-word-delimiter-with-edgengram-ignores-word-delimiter-token/43660/2 "2016-03-08T13:25:12Z")

</div>

I suspect that the word\_delimiter filter returns "tn" but then it gets removed by the edge ngram filter since it has less than 3 chars.

---

<div class="post-metadata">

**Author:** ![batmaci](https://avatars.discourse-cdn.com/v4/letter/b/f08c70/32.png) [@batmaci](https://discuss.elastic.co/u/batmaci)\
**Post date:** [March 8, 2016, 3:28pm UTC](https://discuss.elastic.co/t/using-word-delimiter-with-edgengram-ignores-word-delimiter-token/43660/3 "2016-03-08T15:28:52Z")

</div>

> [@jpountz](#):
>
> I suspect that the word\_delimiter filter returns "tn" but then it gets removed by the edge ngram filter since it has less than 3 chars.

So you mean if I use word\_delimiter with edgengram, word\_delimiter has no use. It will be overriden by edgengram. This is really boring because I dont want to set min:2 as I have "tn" can be found inside the words and they will appear in the list as well.

---

<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:10pm UTC](https://discuss.elastic.co/t/using-word-delimiter-with-edgengram-ignores-word-delimiter-token/43660/4 "2017-07-05T23:10:18Z")

</div>


