ElasticSearch parsing special characters

I've problem with parsing pipe "|" character in elastic. When a record have any special characters no result data.

{
  "query": {
    "bool": {
      "must": [
        {
          "term": {
            "username": "john|doe@group.net"
          }
        }
      ],
      "must_not": [],
      "should": []
    }
  },

Only when I get rid of second element including "|" , when "username": "john" , the results is okay.

Depends on the analyzer you are using here.

I tried by uax_url_email, but no working

Try with keyword analyzer

I've Es 2.4, it tourned out put"type":"phrase", now its ok. Thanks

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