- 🇦🇹Austria drunken monkey Vienna, Austria
It is known and unfortunate that Paragraphs and Search API don’t play very well together.
I usually suggest better using just a “Rendered HTML output” field for making the text inside Paragraph entities available for searches – however, in your case it seems you have already done that and it didn’t work.The first thing I want to note, though, is that you usually shouldn’t add the “Paragraph” datasource to search indexes. This would only make sense if you want the Paragraphs themselves as search results – usually, however, users want the results to be Content items, and the Content’s Paragraphs included in the indexed fulltext for the content. In that case, you should just use the “Content“ datasource and add fields that point to the fields of the Content’s Paragraphs that you want indexed. (Or, as above, use the “Rendered HTML output” field.)
That being said, indexing Paragraphs directly should also work, so it’s still unclear why that search wouldn’t work.
To debug whether the problem is during indexing or during searching, please look into your database, in thesearch_api_db_default_index_text
table. This contains all words indexed for the “Default content index”. By filtering forfield_name = 'field_accordion_title'
you should see all the words indexed for Accordion titles.Anyways, indexing specific fields of Paragraphs is generally not recommended as it is very fragile wrt reorganizing of the Paragraph structure. (When you put that Paragraph into another one, the field will suddenly not be found anymore.) The “Rendered HTML output” field is generally the better solution, if correctly configured (to not include field labels, etc.). But debugging why that doesn’t work in your case is probably even harder, you’d probably need to add debugging code (or an XDebug breakpoint) to
\Drupal\search_api\Plugin\search_api\processor\RenderedItem::addFieldValues()
to see what’s going on/wrong there.In conclusion, this is a pretty site-specific problem so I don’t think I can help you any more than this. You’ll have to debug this yourself, one way or another.