This is a common issue that you have to address as soon as you want to point your one-input-field search engine to any data structure more complex than linear.
The big online search engines can serve as example, but where they draw the line between items and sub items is the real trick:
In the example you can see that a few of the "sub pages" are represented as result item children. But there are obviously more tools from Google, and more sections of The Time of India, than the few ones that they choose to show here. It is an art of fine tuning (by Google's algorithms and manual page admin settings), deciding which to show, and which to not.
So to answer your question, like always, knowing what you want to show comes down to knowing what your user wants to find by typing a certain search string.
Will they search for a top item to find a top item? Then make sure to show the top item when searching for it.
Will they search for a top item to find a sub item? Then show them the subitems, and let it be easy to refine the search if they want to. Or just show them the top one, and let them be able to drill down, or perhaps refine the search once "inside" the chosen top item.
Do you want to provide for both scenarios and provide both types of results at once? Then make sure that the hierarchy is visually clear, like the Google example above.
To round off, the problem might be easier than you think. Perhaps refining the search will come easy for your users? Try to define what the problem for your users actually is, when using your solution. Choosing what to show and what to not show does not have to be as algorithm tense as Google's ranking solutions. As an example, we made a hierarchical search result list for Companies and their Employees. In our case, the line of sub- or super-item was given, perhaps it is in your case too, and then you only have to make a single design per hierarchy level and stick to it. And when searching for Companies or People, it is very easy to refine your search by just typing the full name or perhaps a city, to make the search result short. Perhaps your users will be able to do the same.