- 🇺🇸United States ronchica
I have just experienced a similar issue. To start, in order to implement Search API Solr on Pantheon, I added a new view mode "Search Index" to most of the content types and paragraphs.
I created a custom general template to only output content, no markup: "node--search-index.html.twig". However there are content types that have some preprocessed content I would like indexed, and this wasn't happening. All content types have custom templates for specific view modes.
Preprocess functions (template_preprocess_node for example) were not being fired at all when processing a node for the Search Index view mode. I created a custom view mode template (node--article--search-index.html.twig) that was being indexed by Search API, but again, the content did not contain anything from the preprocess function.
Following the steps above, I created a view mode preprocess function, template_preprocess_node__article__search_index, cleared cache and indexed. This preprocess was fired, and Search API had the preprocessed content. After deleting the function, clearing cache, and reindexing, the original preprocess is fired and all content was indexed.
I experienced similar issues working with paragraphs as noted in issue #2897906, listed as a related issue.
This is confusing (and old), so maybe there is something I am missing here about how to structure the templates, but the behavior is definitely inconsistent. It took me a while to figure out what was going on (why preprocessed content wasn't making it into the search index), although it is working now.