Apache Solr Custom Fields
Component ID
Component name
Component type
Maintenance status
Development status
Component security advisory coverage
Downloads
Component created
Component changed
Component body
Apache Solr module helps you to integrate the ApacheSolr to Drupal, but this module doesn't include all CCK Fields.
Here are 2 HOOKs to add your custom fields to Apachesolr,
1. HOOK_apachesolr_cck_fields_alter
arguments: &$mappings,
add your field_name to this array, and return.
$mapping[‘per-field’][$field_name] =array('callback' => '', 'index_type' => 'string');
2. HOOK_apachesolr_update_index
arugments: $document, $node, $namespace.
so you can add any field to the $document.
Use Apachesolr Custom Fields to get out of any custom code to do this, what you need to is go to administration page and add some settings to determine which field need to be indexed or not.
The mechanism is to store all cck fields settings into database, and add your custom fields settings into database also.
Further more, this module convert those 2 hooks into the same one, and the same interface.
When you go to the page, index.php?admin/settings/apachesolr/custom-fields, there is a list of cck fields, and a link you can add your custom field. Go each field settings page on the page, you will get a page which contains more description on the page.
Apache Solr Indexing Mechanism
Requirements:
Install Apachesolr and config it correctly.
INSTALL:
1. copy module to you drupal module folder.
2. enable it.
Some Videos:
http://www.youtube.com/watch?v=70TlzSN3S60
Since Apache Solr module has ability to index custom fields in Drupal 7, so this module won't be developed in Drupal 7.
Any problem, please visit my blog Drupal与高性能网站架构 | Drupal大å¦
Credit by: 广州Drupalå¼€å‘
