How can I include a views page into my Solr Search API index? When configuring the index, I can select all kinds of content entities, but views pages are config entities.

In my project, I've got one "global" views page based on an index accross all node types and several views pages dedicated to one single node bundle, e.g. an "Events list" views page showing all upcoming events, and a "Restaurant list" views page showing restaurant node types. This works fine for specific/granular keywords showing exact node results.

The problem/task is, when somebody searches for an unspecific/generic keyword like "restaurant" in the global index, the "Restaurant list" views page should show up as search result too (based upon the rendered HMTL output of the views page, which has a lot of "restaurant" in it).
Even though that "restaurant list" doesn't offer additional content, it does offer a different UI (different facets), which makes the restaurant views page a meaningful result for the global search.

I also don't need any views gimmicks or field specific boosts, it would be good enough (or even better) if I could just add an internal URLs rendered HTML output to the existing global index.

  • Search API is used to index your content. Your Restaurant Views page is basically doing the same thing, so this is redundant. lf all Restaurants are already listed in a View, then I'm not sure that Search API is really necessary. You could instead use a Combine Fields filter on your view. If you do still want to use Search API, as well as offering View of all restaurants, then it would probably be better to just embed that View on your search/results page, rather than trying to include it in the results, which makes no semantic sense.
    – Beau
    Dec 7 '20 at 15:28
  • This is technically true (and the same reasoning I gave my client). But in this project the global index/views page and all bundle-specific indexes/views pages have their own specific facets, which - even when partly redundant - qualifies all bundle-specific views pages as a proper and meaningful result for the global index.
    – Hudri
    Dec 7 '20 at 16:15

Your Answer

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

Browse other questions tagged or ask your own question.