Closed (fixed)
Project:
Search API
Version:
7.x-1.11
Component:
Facets
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
6 Aug 2014 at 17:02 UTC
Updated:
12 Sep 2014 at 12:30 UTC
Jump to comment: Most recent
Comments
Comment #1
drunken monkeyFor the view, you could try
Then the second search will have a different search ID and you can just set up the facets to not work on the search.
My approach to the whole problem would have been entirely different, though: implement a Search API processor that postprocesses the search results and, if there are no results, alters the query to remove the facets' filters, executes it again and returns the results of the new search instead. (Just be careful to only re-execute searches that had any filters in the first place, otherwise you'll run into an infinite loop. Same if the facet filters would get re-added, but theoretically a cloned query shouldn't have any preprocessing done anymore anyways.)
Hope this helps.
Comment #2
mnapier commentedThanks for the reply
Not getting the views one to work yet but I'll keep playing with it.
Thanks for pointing out the processors I hadn't played with that option and I got it to work. Although it doesn't give me the opportunity to tell the end user nothing was found for their search and the results are against the whole site. Or at least I'm missing where I might implement that piece.
Thanks again you've given me somethings to play with as I was fed up with it before :)
Comment #3
drunken monkeyYou could probably just do a
drupal_set_message()in the processor method in this case? Or set some static variable somewhere which tells some other part to display the message. Depending on your setup.Anyways, glad I could help!