Has anyone integrated integrated Radioactivity with Apache Solr?

I'm using the apachesolr module for search and would like to add the ability to sort by popularity. The Radioactivity module assigns points to a module based on 'hotness' (fivestar ratings, comments, views, etc). I want to submit the points Radioactivity gives a node to Solr to use as a popularity index.

I believe that means I'll need to modify the schema.xml file on the Solr end and add some sort of hook on the drupal end. Can anyone point me in the right direction?


You should be able to do this without modifying schema.xml. At a minimum, you'll need to implement hook_apachesolr_update_index(), and you may also need to implement hook_apachesolr_modify_query() to add the Radioactivity data to each query.

Good examples for this can be found in the apachesolr_search.module file itself (and the apachesolr_date module that comes bundled with apachesolr), and also in the additional contrib modules apachesolr OG and apachesolr attachments.

The apachesolr_date module in particular has some code related to adding an available sort option.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.