PHP Drupal强制搜索索引更新

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了PHP Drupal强制搜索索引更新相关的知识,希望对你有一定的参考价值。

/**
* Implementation of hook_nodeapi()
* For adding additional data to search index
*
*/
function sitehelper_nodeapi(&$node, $op, $teaser, $page) {
    switch ($op) {

        //Update search index with keyword fields contents
        case 'update':
            if($node->type == 'product') {
                //Add field data to be indexed.
                search_index($node->nid,'node', $node->field_search_keywords[0]['value']);
            }
            break;
    }
}

以上是关于PHP Drupal强制搜索索引更新的主要内容,如果未能解决你的问题,请参考以下文章

Drupal 7搜索API挂钩注册的回调类没有被触发

PHP Drupal:强制管理主题在其他非管理路径上

Drupal 7 GeoField Proximity 使用搜索 API 索引

如何在独立的 PHP 页面中使用 Drupal 搜索?

如何修改drupal搜索模板?

PHP 删除Drupal的搜索块“搜索此站点”标签。