From a performance POV, the current DocumentExchangerInterface is not ideal for the MultipleIndexationRequest use-case.
It can only fetch one document at a time, so it perform 1 SQL request (if SQL is used) for each IndexationRequest instead of possibly one for the whole MultipleIndexationRequest.
Would be nice to add DocumentExchangerInterface::fetchDocuments and use it when appropriate.
From a performance POV, the current DocumentExchangerInterface is not ideal for the MultipleIndexationRequest use-case.
It can only fetch one document at a time, so it perform 1 SQL request (if SQL is used) for each IndexationRequest instead of possibly one for the whole MultipleIndexationRequest.
Would be nice to add
DocumentExchangerInterface::fetchDocuments
and use it when appropriate.