When there are a lot of documents stored in the Document service of a given project, and in addition if there is a lot of metadata stored per documents, the search can leads to a PHP allowed memory size error.
Technical information
From a technical point of view, we have to change how we retrieve the documents in the search. As of today, we retrieve all the documents, with all their metadata values, and then we remove the ones that are not readable by the user and retrieve the sliced part of these documents given the pagination provided.
Now, we change this way of doing. We first retrieve all the documents in the project, but with few information, to filter the ones not readable by the user. Then we slice these information to keep the one expected by the pagination. Then we retrieve all the information & metadata values only for the sliced documents.