Grouping results

What would be the best away to go about group results. For example: two
children contain the word “test” how would I get it to just display its
Parent once? Thanks for the help!