fixing search for document types