Slow Constellio admin interface

During a customer installation of Constellio 1.3, we have noticed an utterly slow loading of the admin interface, which is rather unusual (it is not that slow on other installs with the same amount of indexed content).
After an analysis, we have identified that the Constellio admin UI triggers every 5 seconds a query to its Solr, in order to know the number of indexed files, so as to update this figure in its admin UI. And in our particular installation, this query was taking an awful time to be processed (although the user queries were very fast). We could have changed the query frequency, but even the query by itself was slow. So we decided to change the query in order to have a much better query time. Continue reading