Hello,

I have two questions that I'm not sure how to go about.
1. If a search query is a taxonomy title, I would like to be redirected to the taxonomy page instead of the result page?
2. If a search only returns one result, how can I redirect it to the node page instead of the search result page?

If you could let me know the best way to approach this, I'll appreciate it.

Comments

pwolanin’s picture

For both you'd need a little custom module - you'd need to look at the query term for #1 before the search runs (no real clean way to do this since you only want to do it when the user is looking at a page, not for any API usage of a query - maybe hook_init() if you are desperate) and for #2 you could use hookapachesolr_process_results()

pwolanin’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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

jyg’s picture

That's odd... for #2 I've been trying to turn this off, since it seems 7.x-1.0-beta8 does this one-result-redirect-to-node by default.

jyg