Hey team, when I search for identities based on attributes using the regex pattern, I am not getting the proper response.
the regex pattern is right and it working outside the identity now. Eg. to filter the display name which starts with ‘Ra’ we usually use /\bRa./* but the same is not working in search.
Yes @rasmus_lund, the regex pattern shown in the link is working, but when we write a custom pattern, the application is not able to parse it.
Can you please suggest a working pattern to filter identity based on the first 2 characters? eg. I want to filter all name starts with ‘RA’.
It looks like the main issue with your regex expression is the capital ‘R’. In doing some testing, I found out that the search does not respect the capitalized letters and only works with lower case letters in Regex. If you change it to /ra.*/ then you should pick up the users that you are looking for. I have a topic discussion started on this at the link below.
Additionally, it looks like you have a typo in your regex patter above. You have /\bRa./* when I believe you meant /\bRa.*/
Also, it looks like Elasticsearch does not handle anchor tags, per the last paragraph in this document, and rather always anchors to the start of the word.
Thanks for pointing this out Geoff. I did some more digging and it looks like the default behavior of search is to ignore case and only work with lowercase letters in the search query. If you need case sensitivity, it looks like using the .exact keyword will enable that.
For example, if I need to find all identities with a display name that starts with Aa (ex. Aaron) then the following queries will honor the case sensitivity.