# Using shingles after delimiter\_graph returns weird results

**URL:** <https://discuss.elastic.co/t/using-shingles-after-delimiter-graph-returns-weird-results/123572>\
**Category:** Elasticsearch\
**Created:** [March 12, 2018, 3:11pm UTC](https://discuss.elastic.co/t/using-shingles-after-delimiter-graph-returns-weird-results/123572 "2018-03-12T15:11:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![byronvoorbach](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/byronvoorbach/32/8283_2.png) [@byronvoorbach](https://discuss.elastic.co/u/byronvoorbach)\
**Post date:** [March 12, 2018, 3:11pm UTC](https://discuss.elastic.co/t/using-shingles-after-delimiter-graph-returns-weird-results/123572/1 "2018-03-12T15:11:56Z")

</div>

Hi! 😃

When using a combination of delimiter\_graph and shingles, I do not get the results that I expect.  
Consider the following use case:

```auto
DELETE test
PUT test
{
  "settings": {
    "number_of_replicas": 0,
    "number_of_shards": 1,
    "analysis": {
      "analyzer": {
        "delimited_shingles": {
          "tokenizer": "whitespace",
          "filter": [
            "trim",
            "asciifolding",
            "delimiter",
            "lowercase",
            "shingle"
          ]
        }
      },
      "filter": {
        "delimiter": {
          "type": "word_delimiter_graph",
          "type_table": [
            "$ => DIGIT",
            "& => DIGIT",
            "% => DIGIT",
            "\\u002C => DIGIT",
            "\\u002B => DIGIT"
          ],
          "stem_english_possessive": "false",
          "catenate_all": "true",
          "catenate_words": "true",
          "preserve_original": "true",
          "generate_word_parts": "false",
          "split_on_numerics": "true",
          "split_on_case_change": "false"
        },
        "shingle": {
          "max_shingle_size": "2",
          "min_shingle_size": "2",
          "token_separator": "_",
          "output_unigrams": "false",
          "type": "shingle"
        }
      }
    }
  }
}
GET test/_analyze
{
  "explain": true, 
  "analyzer": "delimited_shingles",
  "text": [
      "grey's anatomy"
    ]
}

#Expected:
#greys_anatomy
#grey's_anatomy

#Actual:
#greys_grey's
#greys_anatomy

```

Based on start\_offset, end\_offset, position and position\_length, I would expect the shingle analyzer to create shingles out of the correct output from the delimiter.  
Is this because non-graph analyzers cannot handle this kind of output? Is this something that would have to be fixed in Lucene or do I have wrong expectations?

In case more info is needed, let me know! 🙂  
Thanks in advance,

---

<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:** [April 9, 2018, 3:12pm UTC](https://discuss.elastic.co/t/using-shingles-after-delimiter-graph-returns-weird-results/123572/2 "2018-04-09T15:12:56Z")

</div>

Closed on April 9, 2018, 3:12pm UTC

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