# Tokenizer pattern with special character not working

**URL:** <https://discuss.elastic.co/t/tokenizer-pattern-with-special-character-not-working/186579>\
**Category:** Elasticsearch\
**Created:** [June 20, 2019, 4:13am UTC](https://discuss.elastic.co/t/tokenizer-pattern-with-special-character-not-working/186579 "2019-06-20T04:13:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![arunkvinam](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/arunkvinam/32/43899_2.png) [@arunkvinam](https://discuss.elastic.co/u/arunkvinam)\
**Post date:** [June 20, 2019, 4:13am UTC](https://discuss.elastic.co/t/tokenizer-pattern-with-special-character-not-working/186579/1 "2019-06-20T04:13:47Z")

</div>

'index' =\> 'contact',

```
            'body' => 
            [
                'settings' => 
                [
                    'number_of_shards' => 3,
                    'number_of_replicas' => 2,
                    "analysis"=>
                    [
                        "normalizer"=>[
                            "lowercase_normalizer"=> [
                                "type"=> "custom",
                                "filter"=> ["lowercase"]
                            ]
                        ],
                        "tokenizer" =>[
                            "comma" =>[
                                "type" => "pattern",
                                "pattern" => "|**|",
                            ]
                        ],
                        "analyzer" =>[
                            "comma" =>[
                                "type" => "custom",
                                "tokenizer" => "comma"
                            ]
                        ]
                    ]
                ],
                'mappings' => [
                   
                        '_source' => [
                            'enabled' => true
                        ],
                        'properties' => 
                        [
                          'appId' => 
                            [
                                'type' => 'long',
                               
                            ],
                        'bank' => [
                            "type" => "text",
                            "analyzer" => "comma"
                        ];
                   ]

```

This is the code iam using .  
It is working when change pattern '|**|' to ','  
But '|**|' this is the pattern i used . comma is not suitable for me

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [June 20, 2019, 11:02am UTC](https://discuss.elastic.co/t/tokenizer-pattern-with-special-character-not-working/186579/2 "2019-06-20T11:02:05Z")

</div>

can you please provide sample documents and a full blown reproducible example that uses real JSON and not the string representation of a language, so that other people can locally reproduce this?

Also I have not fully understood what text sample is working and what is not working and what are the expected results. Please make sure that those things are clear and reproducible.

Thanks!

---

<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 18, 2019, 11:02am UTC](https://discuss.elastic.co/t/tokenizer-pattern-with-special-character-not-working/186579/3 "2019-07-18T11:02:10Z")

</div>

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