Open leleueri opened 2 years ago
search time is very long because of the case insensitive search... By default we create indexes to be case sensitive but we search users with the insensitive option so the index isn't used as it should be.
Here is the documentation about how to create a case insensitive index and how to execute a query using this index : https://docs.mongodb.com/manual/core/index-case-insensitive/
💥 Describe the bug
With a huge amount of users, search request may end in timeout due to the
count
request made to know the number of users. In order to avoid this behaviour, we should apply a limit (ex: 1000) to the count request. As a consequence the number of page display into the UI table will not be accurate but we assume that is there are more than 1000 entries, the AM will search using more restrictive values.Also, take the opportunity of this issue to review default settings about connection timeout for mongo (sockerTimeout, connectionTimeout...)