Note: This was written using apachesolr version 7.x-1.5
The apachesolr module defines a hook that allows a search document to be updated before it is sent to the Solr server for indexing. Actually, I lied, there are two.
hook_apachesolr_index_document_build and hook_apachesolr_index_document_build_ENTITY_TYPE (for specific entity types).
The content is added to Solr via the line $document->setField('index_field_name', $value);
While the example is very simple, this can be used to index values from complex relationships that wouldn’t normally be possible.
Any content that already exists in the index will need to be reindexed.
Now that that new custom field exists, it can be made available for the search results display.
Using hook_apachesolr_query_prepare the search query can be altered, in this case to add the new field.
The new field can also be used to filter search results, again using hook_apachesolr_query_prepare.