Catching nested resource matches for search queries