Adding new facet that's not CCK

aangel - June 17, 2009 - 06:10
Project:Apache Solr Search Integration
Version:6.x-1.0-beta11
Component:Miscellaneous
Category:support request
Priority:normal
Assigned:Unassigned
Status:active
Description

I'm adding a new facet to my install of apache solr and I've reached an impasse. Here's the situation with an inherited database I'm working with.

Via hook_apachesolr_update_index, I've successfully added the department field attached to the user record to the index. It shows up on the apachesolr admin page and has entries. Schema.xml has a new row that looks like this:

   <!-- Used to bring in the department field that is attached to the user -->
   <field name="department" type="text" indexed="true" stored="true" />

Then I went to apachesolr_og and copied the relevant functions into my custom module, making changes along the way to the key creation function, the block function, apachesolr_modify_query and other places. I've turned on the facet block, performed a search and the search returns properly but I don't see the new facet block.

It turns out that apachesolr_facet_block() is failing here:

foreach ($response->facet_counts->facet_fields->$facet_field as $facet => $count) {

When I look at $response from:

$response = $solr->search($query->get_query_basic(), $params['start'], $params['rows'], $params);

I see that $response doesn't have a property facet_counts.

How do I go about tracking this down?

#1

pwolanin - June 17, 2009 - 20:25

See the _og sub-module as an example of adding another facet field.

#2

aangel - June 18, 2009 - 15:10

Hi, Peter.

Thanks, I'm using the example. I'll try to narrow down the question some more.

 
 

Drupal is a registered trademark of Dries Buytaert.