Configuring Solr search to replicate Confluence 'search by space' facet

We’re wondering if it’s possible to configure the Solr search application to filter results from specific ‘spaces’ (i.e. nested pages). We had success configuring the Navigation panel (DocumentTree macro) to make the root level a nested page, but aren’t sure whether its possible to do something similar for the search application?

We would like to replicate the Confluence ‘space’ as an organizational container where we can for our users, given their familiarity with that concept (even though we understand that XWiki has moved away from this model).

Any guidance would be appreciated. Thank you!