Fixed issue where parent & child queries can fail if a segment doesn't have documents with the targeted type or associated parent type

Closes #2537