# Word Delimiter Graph Token + Synonym Graph Token

**URL:** <https://discuss.elastic.co/t/word-delimiter-graph-token-synonym-graph-token/278942>\
**Category:** Elasticsearch\
**Created:** [July 16, 2021, 7:30pm UTC](https://discuss.elastic.co/t/word-delimiter-graph-token-synonym-graph-token/278942 "2021-07-16T19:30:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kushikawa](https://avatars.discourse-cdn.com/v4/letter/k/8baadc/32.png) [@Kushikawa](https://discuss.elastic.co/u/Kushikawa)\
**Post date:** [July 16, 2021, 7:30pm UTC](https://discuss.elastic.co/t/word-delimiter-graph-token-synonym-graph-token/278942/1 "2021-07-16T19:30:31Z")

</div>

I want to use a word delimiter graph token to avoid spliting terms with "+" and "-", e.g. so "3+c" doesn't change to ["3","c"] and stays ["3+c"].  
I also want to define a list of synonyms to be applied to this field after filter tokenization.

Documentation says:

> If you need to build analyzers that include both multi-token filters and synonym filters, consider using the [multiplexer](https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-multiplexer-tokenfilter.html) filter, with the multi-token filters in one branch and the synonym filter in the other.

but I don't see how my delimiter can generate multiple tokens since `catenate_all`, `catenate_numbers`, `catenate_words` and `preserve_original` are all `false`.

But when I tried to create the index without the multiplexer:

```auto
"my_analyzer": {
    "type": "custom",
    "tokenizer": "keyword",
    "filter": [
        "my_delimiter","my_synonyms"
    ]
}

```

it gives me this error:  
`Token filter [my_delimiter] cannot be used to parse synonyms`

And when I tried with multiplexer:

```auto
{
    "settings": {
        "analysis": {
            "analyzer": {
                "my_analyzer": {
                    "type": "custom",
                    "tokenizer": "keyword",
                    "filter": [
                        "my_multiplexer"
                    ]
                }
            },
            "filter": {
                "my_multiplexer": {
                    "type": "multiplexer",
                    "filters": [
                        "my_delimiter",
                        "my_synonyms"
                    ]
                },
                "my_synonyms": {
                    "type": "synonym_graph",
                    "synonyms_path": "analysis/synonym.txt"
                },
                "my_delimiter": {
                    "type": "word_delimiter_graph",
                    "type_table": [
                        "+ => ALPHA",
                        "- => ALPHA"
                    ],
                    "split_on_case_change": false,
                    "split_on_numerics": false,
                    "stem_english_possessive": false
                }
            }
        }
    }
}

```

it continues giving an error, but now is `"Increment must be zero or greater: -1"`  
I also tried to use flatten\_graph without success.  
Where am I doing wrong? Is my request of the multiplexer filter right?  
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:** [August 13, 2021, 7:31pm UTC](https://discuss.elastic.co/t/word-delimiter-graph-token-synonym-graph-token/278942/2 "2021-08-13T19:31:01Z")

</div>

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