Apache Solr Custom Fields


apache solr index mechanism
apache solr screenshot

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
ApacheSolr 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开发


Apache Solr Custom Fields项目的Drush安装命令:复制到剪贴板

注:个别模块仍需开启相关子模块。

项目分类:

周安装量: 
26
维护状态: 
最低限度维护
开发状态: 
仅修复BUG,不添加新功能