Try this. (It may not be the most elegant, in terms of coding, but it’s an easy and safe tweak to do.)
Using Advanced Search, find the system tiddler with this title: $:/core/ui/DefaultSearchResultList
Make a copy (clone) of it, changing the title at the end to something you’ll recognize. (That way, you’re not directly over-writing the default version.)
In the cloned copy, don’t touch the main text body at all. Just change three fields (ignoring back-tick marks, if they show up for you):
first-search-filter:
[!is[system]!has[parent]search:title<userInput>sort[title]limit[250]]
second-search-filter:
[!is[system]!has[parent]search<userInput>sort[title]limit[250]]
caption:
top-level
[or whatever you like, to clarify the doesn’t-have-parent concept]
What these edits do is just to add the string !has[parent]
within the search filters, to exclude tiddlers with content in the parent field.
One last step, with that system tiddler in view mode, is to click on the $:/tags/SearchResults tag-pill to get the dropdown of search-result templates, and rearrange the order of the search result types, so that the new custom search you prefer is listed at top.
Come back if any of that does not seem straightforward!
-Springer