Tokenizer pattern with special character not working

'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

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!

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