Can not create a custom normalizer using char filter [html_strip]

Hello,
I try to save the custom normalizer as part of composite template. Receiving below error:

illegal_argument_exception', 'Custom normalizer [lower_normalizer] may not use char filter [html_strip]

Normalizer is defined as below:

{
    "template": {
        "settings": {
            "analysis": {
                "normalizer": {
                    "lower_normalizer": {
                        "type": "custom",
                        "char_filter": [
                            "html_strip"
                        ],
                        "filter": [
                            "cjk_width",
                            "asciifolding",
                            "lowercase"
                        ]
                    }
                }
            }
        }
    }
}

Thanks

Hi @voaix

I believe it is some limitation of use but if you want to use normalizer to obtain just one token you could use a keyword analyzer.

Ex:

GET /_analyze
{
   "tokenizer": "keyword",
   "filter": [
     "cjk_width",
     "asciifolding",
     "lower case"
   ],
   "char_filter": [
     "html_strip"
   ],
   "text": "this is a <b>test</b>"
}
1 Like

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