0

We are building av website in Drupal 8 where the content is divided into 3 content types;

  • Basic Page, the scaffold for all visual pages like "About, Features etc."
  • Content Block 1, for a layout with one text field and one image
  • Content Block 2, for a layout with one text filed and two images

Nodes on Content Block 1 and 2 are referenced in on Basic Page nodes to enable different designs for each Page. This is done using a view block on Basic Pages.

Now, to the question:

Is there a way to set Search API to index only nodes on Basic Page, rendered with the content of referenced Content Block nodes?

I also need to exclude Content Block nodes from being indexed and showing up as nodes in the results, but that I have a grip on.

I hope my question is clear enough. Please comment otherwise and I will be happy to elaborate.

Thanks!

1

You should be able to traverse through the reference fields on the Search API Add Fields page. Then you want to add all the referenced text fields, so they become part of the main node. However, it is possible that Search API currently has some limitations there, it didn't show configurable fields for me when I tried something similar a few days ago. I'm sure that will eventually be fixed, though. There might be issues already.

PS: You might want to check out Paragraphs. It's a similar concept, with a much better editing experience, you can have different types of embedded content elements and edit it all in the same form. We're working on Search API integration right now and will also look into the problem mentioned above.

1
  • Thanks. I ended upp using the add fields feature in the manner you suggested. – Henkealg May 2 '16 at 6:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.