Implemented last part of getFilteredDocuments ( 44fb60ae95b6dd292622bfe70f318bcb5ffff556 )