XWIKI-9309: Also search in attachments when type is DOCUMENT
* Fix attachment search results display (was showing unuseful document information)
* Refactor the search result display to separate the display for each result type (entity type)

(cherry picked from commit 512f3ab142b5f9fea4ecdde90ecf5a1b455f104f)