Added parameter for excluding documents with specified ID