# Wrong positionLength using output\_unigrams=false

**URL:** <https://discuss.elastic.co/t/wrong-positionlength-using-output-unigrams-false/373870>\
**Category:** Elasticsearch\
**Created:** [January 30, 2025, 6:23am UTC](https://discuss.elastic.co/t/wrong-positionlength-using-output-unigrams-false/373870 "2025-01-30T06:23:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexander.korkhov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alexander.korkhov/32/133918_2.png) [@alexander.korkhov](https://discuss.elastic.co/u/alexander.korkhov)\
**Post date:** [January 30, 2025, 6:23am UTC](https://discuss.elastic.co/t/wrong-positionlength-using-output-unigrams-false/373870/1 "2025-01-30T06:23:12Z")

</div>

For example, I have next settings:

```auto
PUT test_search_05
{
  "settings": {
    "analysis": {
      "analyzer": {
        "shingle": {
          "tokenizer": "standard",
          "filter": ["my_shingle_filter"]
        }
      },
      "filter": {
        "my_shingle_filter": {
          "type": "shingle",
          "min_shingle_size": 2,
          "max_shingle_size": 5,
          "output_unigrams": false
        }
      }
    }
  }
}

```

Next, analyze

```auto
GET test_search_05/_analyze
{
  "analyzer": "shingle",
  "text": "quick brown fox"
}

```

I see:

```auto
{
  "tokens" : [
    {
      "token" : "quick brown",
      "start_offset" : 0,
      "end_offset" : 11,
      "type" : "shingle",
      "position" : 0
    },
    {
      "token" : "quick brown fox",
      "start_offset" : 0,
      "end_offset" : 15,
      "type" : "shingle",
      "position" : 0,
      "positionLength" : 2
    },
    {
      "token" : "brown fox",
      "start_offset" : 6,
      "end_offset" : 15,
      "type" : "shingle",
      "position" : 1
    }
  ]
}

```

There are wrong positionLength in all tokens (one less).  
Without {"output\_unigrams": false} it works correctly.

How can I resolve that problem?
