Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Apress.Pro.Drupal.7.Development.3rd.Edition.Dec.2010.pdf
Скачиваний:
74
Добавлен:
14.03.2016
Размер:
13 Мб
Скачать
☆

CHAPTER 13 ■ SEARCHING AND INDEXING CONTENT

// Format the search results $results[] = array(

'link' => url($legacy_url . 'note.pl', array('query' => $item->sid, 'absolute' => TRUE)),

'type' => t('Note'), 'title' => $note->title,

'date' => $note->last_modified, 'score' => $item->score,

'snippet' => search_excerpt($keys, $note->note));

}

return $results;

}

After cron has run and the information has been indexed, the technical notes will be available to search, as shown in Figure 13-7. They will be indexed inside Drupal, but legacysearch_search() will return search results that are built from (and point to) the legacy system.

Figure 13-7. Searching an external legacy database

Summary

After reading this chapter, you should be able to

•Customize the search form.

•Understand how to use the search hook.

•Understand how the HTML indexer works.

•Hook into the indexer for any kind of content.

322

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]