# Issue when combining shingle filter and stopwords

**URL:** <https://discuss.elastic.co/t/issue-when-combining-shingle-filter-and-stopwords/40119>\
**Category:** Elasticsearch\
**Created:** [January 26, 2016, 1:06pm UTC](https://discuss.elastic.co/t/issue-when-combining-shingle-filter-and-stopwords/40119 "2016-01-26T13:06:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mdebo](https://avatars.discourse-cdn.com/v4/letter/m/9dc877/32.png) [@mdebo](https://discuss.elastic.co/u/mdebo)\
**Post date:** [January 26, 2016, 1:06pm UTC](https://discuss.elastic.co/t/issue-when-combining-shingle-filter-and-stopwords/40119/1 "2016-01-26T13:06:04Z")

</div>

Hi,  
I encounter an issue with elasticsearch shingle filter. As the matter of fact, when i combine shingle filter and stopwords, it seems that the option output\_unigrams, which I set to false, is no more taken into account.

This is the configuration of the analyzer I'm using:

```
        "shingle_french" => {
            "tokenizer" : "standard",
            "filter": ["standard", "lowercase", "french_stop", "filter_shingle"]
        },

```

And the filters:

```
        "filter_shingle": {
          "type": "shingle",
          "max_shingle_size": 5,
          "min_shingle_size": 2,
          "output_unigrams": false,
          "filler_token": "",
          "output_unigrams_if_no_shingles": true
        },
        "french_stop": {
            "type": "stop",
            "stopwords": "_french_"
        }

```

When I analyse the tokens generated by the query "porte de garage", I have this result:

porte  
start: 0 end: 9 pos: 1  
porte garage  
start: 0 end: 15 pos: 1  
garage  
start: 9 end: 15 pos: 2

However, I would like to only obtain one token: "porte garage"  
What am I doing wrong?

Thank you in advance.

---

<div class="post-metadata">

**Author:** ![Eduard\_Dudar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eduard_dudar/32/2845_2.png) [@Eduard\_Dudar](https://discuss.elastic.co/u/Eduard_Dudar)\
**Post date:** [March 16, 2016, 2:06am UTC](https://discuss.elastic.co/t/issue-when-combining-shingle-filter-and-stopwords/40119/2 "2016-03-16T02:06:47Z")

</div>

`"filler_token": ""` does not works as you probably expect here. Your N-grams are `"porte de"`, `"porte de garage"` and `"de garage"` where `"de"` is replaced with `""` lead to `"porte "`, `"porte garage"` and `" garage"` effectively or something close to this.

I think that ES team actually expects that `filler_token` will be some meaningful but 'unusual' symbol so that `"something <filler>"` never fires. But that's just a suspicion rather than fact...

---

<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:08pm UTC](https://discuss.elastic.co/t/issue-when-combining-shingle-filter-and-stopwords/40119/3 "2017-07-05T23:08:06Z")

</div>


