Correct analyzer for a field with backslash

So, I'm trying to setup a new index mapping with the correct analyzer for a Windows credential field, which has the format domain\username.

I want to be able to search for domain, username AND domain\username. But the default analyzer seems to ignore the backslash (meaning, if I try to search for domain\username it will search for "domain OR username" ignoring the backslash), and if I try the whitespace analyzer it seems to only match on domain\username.

Any tips?

How about using pattern analyzer https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-pattern-analyzer.html

that maybe could work... but I also asked about this on Stack and received a suggestion to use the path_hierarchy, it worked perfectly!

https://stackoverflow.com/questions/60924725/correct-analyzer-for-a-field-with-backslash/

huh... the preview is showing a different post, for some reason? O.o

1 Like

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