I just realised that Drupal 8 search does not find content placed in blocks. Is that true or a setting not set right?

Thanks for the help

Anders

Comments

Jaypan’s picture

Search does not search blocks. Blocks can be on any number of pages, so there is no canonical link to which a search result could point.

Also, your post isn't in regards to coding or developing a module, so you should move it to the Post Installation forum.

andersduus’s picture

moved :-)

I understand the structure of block but I would expect that I could choose to return all content placed on a node including blocks. Is there no way to do that? or do we need to install a external search engine?

Jaypan’s picture

Blocks are assigned to paths, not nodes, so there isn't a direct relation between them. The search by default searches only the main content of a page, not blocks. You would need an external search engine that indexes based on the entire HTML of the page, rather than the Drupal search which indexes on a programmatic level.

extravioar’s picture

If you use the paragraphs module and define a paragraph that references a block, you have a block linked to a node. The search API supports it as you can select Content > Paragraphs > Blocks > Body in the Search Fields form.
So I think there should be a search hook on the Block object as well.