Fixed logic for displaying documents in post-type-search