2

By default drupal will only send nodes to apachesolr, is there a way to send views pages to solr, so that they may show in the search index?

I know this question seems a little out there, just looking to see what clever minds within Drupal think about what can be done here.

1

3 Answers 3

3

Thought I would post about how we ended up solving this:

  • Installed the module https://drupal.org/project/viewfield (which has a 7.x-dev release)
  • Created a new content type called 'Section Overview'
  • Added a viewsfield to the content type 'Section Overview' that allows the author to choose the view they wish to embed from a dropdown list
  • Told apachesolr to index nodes of type 'Section Overview'

In the end it was not that hard, just took some lateral thinking.

3
  • 1
    Worth noting that while this is neat it's a workaround only -- still only about indexing nodes (with views embedded in fields), not a view page as such.
    – Vacilando
    Commented Feb 15, 2013 at 8:42
  • 1
    Also, one might consider drupal.org/project/viewreference as an alternative to drupal.org/project/viewfield
    – Vacilando
    Commented Feb 15, 2013 at 8:52
  • 1
    @Vacilando As of 2020, View Reference is being replaced with View Field in Drupal 8, so go with View Field.
    – mbomb007
    Commented Jul 14, 2020 at 13:56
2

Yes, there's a (half-finished Drupal 6) module for it too: http://drupal.org/project/apachesolr_views

** DISCLAIMER - I've never actually used this. Just know of it, considered it recently. ;-)

4
  • Seems like a winner, just wish I was running views 3.x and apachesolr 2.x. Thanks for finding this, might be a good start
    – wiifm
    Commented Mar 23, 2011 at 8:25
  • There is a commit further back in VCS that supports Views 2 - this is what we were considering. It seemed stable.
    – Greg
    Commented Mar 23, 2011 at 9:50
  • This module will not help you it provides a views interface to solr. I think what you are asking for is getting solr to parse views. Commented Mar 23, 2011 at 13:08
  • you are correct Jeremy, I am after a way to get Solr to index views pages essentially, and display them in search results (not to theme the resulting search results)
    – wiifm
    Commented Mar 28, 2011 at 23:26
-3

Solr indexes your content. Views displays your content. The stuff that views can display....is still content. You build views from the indexed content, not build an index from a view. Solr indexes your db, and doesn't parse pages.

2
  • 2
    I am well aware of what Solr and views do, this is a request from a client, and from their point of view, a views page is still a 'page' and therefore should be searchable. I am after what solutions anyone has found to this issue.
    – wiifm
    Commented Jun 26, 2011 at 2:50
  • There is no solution because there is no issue to begin with. Everything views can display is definitely searchable. You, or the client, is thinking of things backwards. You can make anything indexable in Solr, you just have to create a custom module if it is out of the scope of what apachesolr.module does. It would be silly to have Solr index a views page. The statement alone is not valid, because it is backwards to logic.
    – picxelplay
    Commented Jun 26, 2011 at 4:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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