Refactor TSearch#tsdocument