In #orgmode, if you don’t like how org-occur
or org-ql-sparse-tree
represent their results, you should have a look at the org-fold-show-context-detail
variable.
By default, it will only show headlines even if there is a match inside the entry. To show the matching text entry as well, add this to your config:
(add-to-list 'org-fold-show-context-detail '(occur-tree . local))