By setting not_analyzed , you only allow exact matches (for example, "SOMECODE/FRED" , including random and special characters).
I assume that you are using a standard analyzer (this is the default analyzer if you do not specify it). If this is the case, Standard will process slashes as a token separator and generate two tokens [somecode] and [fred] :
$ curl -XGET 'localhost:9200/_analyze?analyzer=standard&pretty' -d 'SOMECODE/FRED' { "tokens" : [ { "token" : "somecode", "start_offset" : 0, "end_offset" : 8, "type" : "<ALPHANUM>", "position" : 1 }, { "token" : "fred", "start_offset" : 9, "end_offset" : 13, "type" : "<ALPHANUM>", "position" : 2 } ] }
If you do not want this behavior, you need to switch to a tokenizer that is not divided into special characters. However, I would question the precedent for this. Typically, you will want to break up these types of characters.
Zach
source share