Prepare multiple query operators for targetDocument IDs

This fixes an additional bug found while refactoring `prepareQueryElement()` in #485. Only the first query operator was prepared for targetDocument IDs.