hook_search_preprocess

  1. drupal
    1. drupal6 core.php
    2. drupal7
Versionen
drupal6 – drupal7 hook_search_preprocess($text)

Preprocess text for the search index.

This hook is called both for text added to the search index, as well as the keywords users have submitted for searching.

This is required for example to allow Japanese or Chinese text to be searched. As these languages do not use spaces, it needs to be split into separate words before it can be indexed. There are various external libraries for this.

Übergabeparameter

$text The text to split. This is a single piece of plain-text that was extracted from between two HTML tags. Will not contain any HTML entities.

Rückgabewert

The text after processing.

Verwandte Themen

Code

modules/search/search.api.php, line 218

<?php
function hook_search_preprocess($text) {
  // Do processing on $text
  return $text;
}
?>

Kommentare

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen