What's the proper way to query all the users of an AEM installation.
Hello,
Do you guys know what's the proper way (if exists) to query all the users in the system (under /home/users)?
We have a site for one of our clients in which in one component they need to select a user from the system, it can be any user. Currently we use the following query to retrieve the users based on a search term ("%s").
SELECT * FROM [nt:unstructured] AS p WHERE (ISDESCENDANTNODE([/home/users]) AND (CONTAINS(p.email, \"*%s*\") OR CONTAINS(p.givenName, \"*%s*\") OR CONTAINS(p.familyName, \"*%s*\") OR CONTAINS(p.preferredName, \"*%s*\")) AND [email] IS NOT NULL AND [id] IS NOT NULL)
There are a lot of users in the system, we use SAML so the profiles have a lot of custom properties. Using this query and an admin session is pretty much what we do to retrieve the users.
Currently we're experiencing some performance issues and the query is starting to take more and more time.
Is there like an out of the box feature for AEM to do this?
Any help is greatly appreciated.
Thank you so much.