Hi
My taxonomy term pages are provides via panels.
Is it possible to display solr search results on a taxomy term page?

thx
bennos

Comments

zach harkey’s picture

I have the same exact question.

zach harkey’s picture

Ok, I figured out how to do this.

1. Make sure to disable "Use ApacheSolr for taxonomy links" (/admin/settings/apachesolr -> Advanced configuration)
2. Enable Panels' Taxonomy term template (/admin/build/pages).
3. Edit your Taxonomy term template panel variant to replace the 'taxonomy_term' pane with the ApacheSolr search results pane (Add content > ApacheSolr Search > ApacheSolr Search results. Use these settings.

4. Add as many additional ApacheSolr panels as you need for facet searching. See screenshot of my configuration.

I'm so happy about this.

ximo’s picture

Status: Active » Fixed

That's a smart use I hadn't thought of. Sounds like you found the best solution too. Thanks for sharing the step-by-step instructions!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

auraell’s picture

I am not seeing "ApacheSolr Search" in the Add Content options. Do you know why this might be? I'm on Drupal 7.

shawn dearmond’s picture

Status: Closed (fixed) » Needs work

#2 is a creative solution, but it's not exactly right. Simply searching by the text of the taxonomy term title isn't good enough. It needs to list all items marked with that term no matter what. Just like the Solr taxonomy term page does.

shawn dearmond’s picture

Version: 6.x-1.0-beta1 » 7.x-1.x-dev
Component: Miscellaneous » Code
Category: support » feature

Since it doesn't seem to be possible, let's put this as a Feature Request for 7.x-1.x

acbramley’s picture

Status: Needs work » Postponed (maintainer needs more info)

Can you provide more information about exactly what you are trying to achieve and how it is not possible in 7.x currently. Cheers

shawn dearmond’s picture

Status: Postponed (maintainer needs more info) » Active

The panels pane that's available from this module is "Solr Search Results". But the only field that's available for input is "Keywords". That's great for the standard search results page. I can put the term name into the keywords, but it just ends up being a keyword search for the taxonomy term name.

However, what I'm using now is the Taxonomy Page provided by the apachesolr module. This hijacks the standard Taxonomy page and turns it into a Solr search result page. The difference here is that it specifically results in only those results which are tagged with that term. (and then lets me do facets and other awesomeness).

Ideally, I would have best of both worlds: A panels layout that I can customize to my heart's content, including the search results pane displaying only those specifically tagged with that term.

If there is some way to do this with the current module, I'd love to hear it because I couldn't figure it out.

Thanks!

acbramley’s picture

Status: Active » Closed (fixed)

Hi @Shawn

Rather than the Keywords override you should use the filters override! This takes arguments in the form of solr__fiekd_key:value

For example if you wanted a search results pane that was filtered by a taxonomy term automatically you would select "Append to" next to filters and add something like the following into the text field:

im_field_my_taxonomy_field:%taxonomy_term:tid

Selecting Append to means that you can use things like Facet API to further filter your pages without overriding this one.

EDIT: You must also make sure that "Use context keywords" is also ticked in the search results pane config.

shawn dearmond’s picture

That worked perfect!

Thanks!

Aaron23’s picture

#2 Configuration page link not working now. Can you provide it?