Using hooks for processing all results and facets - Apachesolr 1.0

Events happening in the community are now at Drupal community events on www.drupal.org.
yasheshb's picture

Hello,

We're trying to filter the results provided by apachesolr in the hook apachesolr_process_results (not sure if this is the right place)
Here's what i'm trying for a franchise locator

Content Type: Franchisee (bunch of fields for title, type, services provided etc + location cck)
Number of nodes: 2000

Now we're building an Advanced Search form which combines the facets for Franchise Type and a proximity search using
Zipcode + Radius.
The form captures the user input
keywords, franchise_type, zipcode + radius.

The intent of the form submission is to provide all Franchise of a particular type and within a finite radius of a zipcode (for a keyword)

Upon form submit, we're redirecting them to the apachesolr search url which contains the filters for facet franchise_type with our params for
radius+zipcode.

so the url would look something like http://www.example1.com/search/apachesolr_search/pizza?filters=type%3A11...

The results are initially generated by the apachesolr query - http://www.example1.com/search/apachesolr_search/pizza?filters=type%3A11
We then have a custom module and in the hook apachesolr_process_results we are using the $results to filter the nodes based on the combination
of radius + zipcode.

The problem here is
- $results is only showing the current 10 nodes for the page (nodes/page=10)
- The facets don't get updated upon the manipulation of the $results.

Is there another hook/technique one can use to essentially filter the entire $results and also ensure the facets reflect the filtered $results.

Thanks.

Yashesh Bhatia

Comments

Subscribing...

vivekisontrack's picture

I am subscribing to this post... I am also interested in trying to figure out how to ensure that facets reflect results that have been filtered in a hook.

Lucene, Nutch and Solr

Group organizers

Group categories

Projects

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: