Char_filter how to replace backslashes with slashes


(Евгений Соколов) #1
"analysis": {
      "char_filter": {
        "replace_bad_slash": {
          "type": "mapping",
          "mappings": [
            "\\ => /"
          ]
        }
      },
      "normalizer": {
        "my_normalizer": {
          "type": "custom",
          "char_filter": ["replace_bad_slash"],
          "filter": ["lowercase"]
        }
      }
    }

When attept to load tempate:

elasticsearch.exceptions.TransportError: TransportError(500, 'runtime_exception', 'Invalid escaped char in [\\]')

(Alexander Reelsen) #2

you may have to do some double escaping here, like \\\\... also what language are you testing this?


(Евгений Соколов) #3

Thank you! Its work.


(system) #4

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