Reworked post-type-search-document logic