I have a site-wide search page that's powered by Search API and Search API Solr. It returns results straight from an index that contains content from various entity types (files, nodes, taxonomies, etc.). Among the things rendered in the search result is a description, a short blurb of text from the content.
The problem I have is that this blurb isn't just one field. The different entities use different fields as their description field. They have different required states, so some of them are guaranteed to have values, while others can be blank. Some entities don't even have the field at all.
How do I index all entities to have a single "description" field that could come from one of many possible fields?
field_page_description(Article content type has this)
field_something_description(Basic Page content type has this)
field_another_description(Another Page file type has this)
I want to check
field_page_description first if it exists and has a value. If it does, index that. If it doesn't, repeat the process on the next field. If all of the fields are empty or non-existent, the index value indexed shall be blank. In the end, I'd have a single field in the index whose value comes from any one of the three fields.
How should I go about this?