01 May

Alfresco retrieves 1,000 results maximum or query for a couple of minutes with Apache Lucene

Did you know that Alfresco retrieves a maximum of 1,000 results in a single query, when using Apache Lucene?

Did you know that Alfresco stops a query after a couple of minutes of duration of a single query, when using Apache Lucene?

This is not a strange thing and it’s well known from most of the Alfresco’slucene_apache experts. Below some discussions about that:

  1. Alfresco Forum
  2. Stack Overflow

The reason is clear: Alfresco limits the number of results and duration of a single query to ensure a good level of performance of the whole system in the average case. And to do that Alfresco stops the execution of a query when only one of the two limits is reached.

For that reason you can obtain less than 1,000 results, even if the correct result should be 1,000 or more, because is reached a couple of minutes of the query. Or you can obtain a maximum of 1,000 results even if your query retrieves the results immediately.

Of course this is true in most of the cases but sometimes these settings could be a limit, you would like to change to solve your problems. To change the maximum number of retrieved results and/or the maximum duration of a query, you can modify the property file:


In these two settings:

# Properties to limit resources spent on individual searches
# The maximum time spent pruning results
# The maximum number of search results to perform permission checks against

But remember to pay attention on that tuning…

Another suggested solution is to switch to Apache Solr Engine but not all the people think it’s a good idea.