Panels and Search

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
aangel's picture

I'm implementing many landing pages in Panels that each have unique content that I'd like to be indexed and available via Drupal's built-in search. A quick search for "update_index" in panels came up empty so I'm assuming that Panels does not update the search index.

I have found just the following guidance so far: Custom Content and Search Index, which is rather old. In it Sam says:

The built-in drupal search system searches node content; it doesn't know to search panels content. And it shouldn't; panels custom content panes are _really_ not supposed to be anything more than a convenient, quick-fix/hack tool. By and large, if you're putting information that needs to be accessible via searches into panels custom content types anyway, then it probably points to some weaknesses in your data model. Substantive data should almost never be DEFINED in Panels - Panels should be using one of its numerous mechanisms for pulling data in from elsewhere to find it.

The notion that "substantive data should almost never be DEFINED in Panels" seems like a rather artificial rule. Can anyone say where this view comes from? Is it still the prevailing notion?

If it is still the prevailing notion and Panels doesn't permit indexing of custom content within it, it seems that the best alternative way of getting panels content indexed is to embed a custom node (which is indexed) then alter the search results to point to the panel containing the custom node rather than the lonely node itself. Dmitry suggests using Path Redirect, which is an alternative method.

Any guidance is much appreciated.

Comments

Indexing Panel Content

windtrader's picture

I generally agree with the quote except that Panels to me is far more than a fix/hack tool. Maybe when this was written Panels was less used and proven but currently there is a growing idea to move toward site building and themeing using Panel and Panes as a central enabler.

My view of Panels is it is primarily a way to organize and present node data and that is the fundamental data that should be indexed. If your definition of "unique content" includes custom text and labels and such defined as part of the Panel display, then I do not think the main indexer should look at this as I do not view it as the core data being managed by Drupal.

Don

Right now, the only viable

merlinofchaos's picture

Right now, the only viable solution is apache solr. It can index anything, not just nodes.

Until Drupal's core search gets over its naivete that the only content worth reading is in a node, we don't have much choice.

Extend functional search option in core

windtrader's picture

If there is sufficient expressed interest for extending core search to index more than node data, it seems through the existing community processes this can be requested and extended source search options could be implemented. And this may be the case already, I just don't follow it.

Thoughts on directing nodes?

aangel's picture

Thank you both for your comments.

Eventually, I think panel content will get indexed and become searchable without having to go through the extra work of embedding a node and doing the extra work I'm looking at. But that ability isn't there today, which means that I have to point the user to the containing panel when a node displayed within a panel holds some indexed text.

The mechanisms I see for that currently are:

  • rewriting the search results page to point to the containing panel of a node (pulling up a node won't redirect the user like the second method and third methods)
  • write a hook that redirects the page display when pulling up a node
  • using Path Redirect (more upfront manual work for the customer)
  • ???

I'm leaning toward rewriting the search results...do either of you see a way I may be missing? What have other people done in this situation?


Andre Angelantoni
Founder, PostPeakLiving.com

As was mentioned above there

windtrader's picture

As was mentioned above there is a solution, just not in core search. Use solr for your search engine and you should get what you want.

Need alternative

aangel's picture

Sorry, Don, I should have mentioned that the University has already decided that they do not want to run Solr at this time, hence my search for alternatives.


Andre Angelantoni
Founder, PostPeakLiving.com

The search by page module

gpk's picture

The search by page module might do some of what you are looking for. From looking at the project description it looks like you would need to specify the relevant panel paths that you want indexed - I don't yet see any sign of a Panels sub-module for SBP that does this automatically for you.