Adding new facet that's not CCK
| Project: | Apache Solr Search Integration |
| Version: | 6.x-1.0-beta11 |
| Component: | Miscellaneous |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
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
See the _og sub-module as an example of adding another facet field.
#2
Hi, Peter.
Thanks, I'm using the example. I'll try to narrow down the question some more.