0

I have Search API SOLR running on my Drupal 8 site and I'd like to know if there is a way to have view pages display in my search results.

As an example, I have a database content type that allows users to put in the name of the database, the custom URL to link to the external database and a short description of it. The way I display this content on my site is with a view that can be filtered with certain criteria.

The actual node of these databases is never linked to and I never want users to end up on these node pages. However, if I search for the name of a database, it won't show up because I've disallowed that content type in my search settings but I still want that view page to be found when searching for the name of a database.

Can anyone help me figure out how to get view pages or pages with view block result to show up in my search results so that certain content type nodes that are never meant to be seen don't end up in the results?

0

The Search API supports views out of the box. You just need to create a new view and select the "Index" you want to search. E.g. Index Full Site or Index Resources. These match the indices you have created in the Search API setup.

This will let you get any 'fields' in the index and use some Search API specific filters (e.g. Fulltext search which looks across all index fields.).

There are some options that refer to Datasource information. This is the way you can take information from the index and related it to the full node. Depending on your needs, you may need to use Relationships to get to other items, e.g files or images.

There are a fair number of tutorials on this, just search for them.

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.