Faceted Search Integration
linksunten - May 16, 2009 - 12:57
| Project: | Finder |
| Version: | 6.x-1.0-alpha28 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | won't fix |
Description
We'd love to see an integration with Faceted Search. Especially an autocomplete search on taxonomy terms (e.g. locations) which sets the according facet would be nice. This patch for faceted search to exclude facets from the guided search block could be useful in this context.
So in fact this feature request has two components:
(a) Extend finder so that taxonomy terms can be found (probably through a new submodule)
(b) Add an option so that instead of a finder result page the according facet is set, that is the according faceted search result page is called or the term is added to the result page. So the URL of the faceted search result page should suffice as an API to faceted search

#1
Sorry I don't know much about faceted search so I don't know how to integrate it at this point. I welcome any code samples and advise though.
You can already find taxonomy terms with finder using a views finder.
#2
Thanks for your answer and this marvellous module.
We built a view for our location terms and the autocomplete works great. So (a) was indeed already implemented.
It turned out - after we have tried to understand your code - that (b) is also nearly implemented. We only need to understand how to override the theme function, then we can redirect to the faceted search URL using "taxonomy:". $result->{$result->base_field} as argument. We'll post the code here when it works.
We found a tiny bug in finder_views.module and wrote a patch that is attached to this comment. As you seem to be working on the project at the moment, we give this feedback now.
#3
We found another small bug (patch attached). After reading #458680: Finder Views: redirect to result we understood that a simple
<?phpfunction myfunction_finder_views_goto_result_alter($finder, $result) {
$id = &$result->{$result->base_field};
switch ($result->base_table) {
case 'term_data':
drupal_goto('my_base_path/results/taxonomy:'. $id);
}
}
?>
suffices to start a faceted search on a taxonomy term resulting from a views search with finder. Now we have to figure out how to extend a faceted search...
#4
The bug patches are not related to the topic. This thread is specifically about Faceted Search integration. I cannot track bugs properly if they are filed under an issue with a feature.
Please also provide explanation of the bug you've found and what your intended solution is, as I do not understand your patch in #3. The intention of this drupal_alter() is to allow altering of the results, not of the finder - so by changing the order of parameters you have disabled this ability. By design you should avoid drupal_alter on a $finder, and use finder_invoke_finderapi() instead.
I have perhaps not used finder_invoke_finderapi() in as many places as I should, like results, and in the submodules doing their processes - another thing I should review.
#5
I've created new issues to continue these discussions:
Finder views settings - http://drupal.org/node/464840
hook_finderapi availability - http://drupal.org/node/464842
#6
Ok, in the future we'll file a new issue for every bug we find. We thought we found a simple distortion of arguments in #3. If this is not the case forget about the patch. We'll look into the faceted search integration again as soon as someone answered #464778: Faceted Search & Finder or if we find the answer on ourselves.
#7
This function works to start a facet search (without patch #3 which seems to be born by lack of understanding so forget about it):
<?phpfunction linksunten_finder_views_goto_result_alter($result, $finder) {
$id = &$result->{$result->base_field};
switch ($result->base_table) {
case 'term_data':
drupal_goto('filtersearch/results/taxonomy:'. $id);
break;
case 'users':
drupal_goto('filtersearch/results/author:'. $id);
break;
}
}
?>
What we really want to do is a redirection to a different URL (to set another facet) based on the previous URL and the chosen taxonomy term/author. The above approach does not work since finder first redirects to /finder/XX and thus the feacet search environment (the previous URL) is lost.
#8
Hi im using facted search module in my drupal project(V:5.7)
I would like to know whether it is possible to exclude the contents created from a particular user role in the facted search, i tried using author facet and excluded a role by checking it. but it didn't help me.
Is there any one who can resolve my issue.Its really urgent :(.
#9
#10
I haven't seen much more interest in this feature, and I am unfamiliar with faceted search so I probably won't be making this. If faceted search is simply url based like that, then you can always use that hook to do it. If not then you'll have to hack together a module yourself, you can learn a bit from Finder Search and the other modules here.
This is a perfect example of a module that someone with some knowledge of the faceted module could come along and make.