Fix document search issues