Steps to Reproduce
- Create a regular role with these permissions:
Portal: View Control Panel Menu
Users and Organizations: Access in Control Panel
- Create a new Site
- Create a user with lastname "AAA" and make them a member of the new Site
- Assign them the Regular Role and Site Admin Role for the new Site
- Create 10,050 users. Can use a Groovy script
- Log in with created user or impersonate the user and visit the Users and Organizations page (takes some time to load)
Expected Result: The only user viewable is the user with lastname "AAA" and the count is correct (in this case not visible).
Actual Result: The only user viewable is the user with lastname "AAA" and the count not correct displaying something like "Showing 1 to 20 of 51 entries."
Reproducible on e69a4a10d4149b40169f4caf79748f028ab38fbc
LPS-130220 will change the query behavior so not as many users will be returned in the above use case, HOWEVER this does not actually fix all cases of the issue.
This behavior happens because IndexerSearcherImpl.searchCount() will only return a maximum of 10,000 hits from search(). But more results maybe present. The actual count size is calculated once here instead of recursively which would be necessary if over 10,000 results are available.