search_index_split

search_index_split($text, $langcode = NULL) Simplifies and splits a string into words for indexing. Parameters string $text: Text to process. string|null $langcode: Language code for the language of $text, if known. Return value array Array of words in the simplified, preprocessed text. See also search_simplify() File core/modules/search/search.module, line 361 Enables site-wide keyword searching. Code function search_index_split($text, $langcode = NULL) { $last = &drupal_static(__FU

search_expand_cjk

search_expand_cjk($matches) Splits CJK (Chinese, Japanese, Korean) text into tokens. The Search module matches exact words, where a word is defined to be a sequence of characters delimited by spaces or punctuation. CJK languages are written in long strings of characters, though, not split up into words. So in order to allow search matching, we split up CJK text into tokens consisting of consecutive, overlapping sequences of characters whose length is equal to the 'minimum_word_size' variable. T

search_form_search_block_form_alter

search_form_search_block_form_alter(&$form, FormStateInterface $form_state) Implements hook_form_FORM_ID_alter() for the search_block_form form. Since the exposed form is a GET form, we don't want it to send the form tokens. However, you cannot make this happen in the form builder function itself, because the tokens are added to the form after the builder function is called. So, we have to do it in a form_alter. See also \Drupal\search\Form\SearchBlockForm File core/modules/search/search.m

search_index_clear

search_index_clear($type = NULL, $sid = NULL, $langcode = NULL) Clears either a part of, or the entire search index. This function is meant for use by search page plugins, or for building a user interface that lets users clear all or parts of the search index. Parameters string|null $type: (optional) The plugin ID or other machine-readable type for the items to remove from the search index. If omitted, $sid and $langcode are ignored and the entire search index is cleared. string|null $sid: (op

search_index

search_index($type, $sid, $langcode, $text) Updates the full-text search index for a particular item. Parameters string $type: The plugin ID or other machine-readable type of this item, which should be less than 64 bytes. int $sid: An ID number identifying this particular item (e.g., node ID). string $langcode: Language code for the language of the text being indexed. string $text: The content of this item. Must be a piece of HTML or plain text. Related topics Search interface The Drupal searc

search_help

search_help($route_name, RouteMatchInterface $route_match) Implements hook_help(). File core/modules/search/search.module, line 72 Enables site-wide keyword searching. Code function search_help($route_name, RouteMatchInterface $route_match) { switch ($route_name) { case 'help.page.search': $output = ''; $output .= '<h3>' . t('About') . '</h3>'; $output .= '<p>' . t('The Search module provides the ability to set up search pages based on plugins provide

SearchQuery::prepareAndNormalize

public SearchQuery::prepareAndNormalize() Prepares the query and calculates the normalization factor. After the query is normalized the keywords are weighted to give the results a relevancy score. The query is ready for execution after this. Error and warning conditions can apply. Call getStatus() after calling this method to retrieve them. Return value bool TRUE if at least one keyword matched the search index; FALSE if not. File core/modules/search/src/SearchQuery.php, line 391 Class Sea

search_dirty

search_dirty($word = NULL) Marks a word as "dirty" (changed), or retrieves the list of dirty words. This is used during indexing (cron). Words that are dirty have outdated total counts in the search_total table, and need to be recounted. File core/modules/search/search.module, line 169 Enables site-wide keyword searching. Code function search_dirty($word = NULL) { $dirty = &drupal_static(__FUNCTION__, array()); if ($word !== NULL) { $dirty[$word] = TRUE; } else { return $d

SearchQuery::searchExpression

public SearchQuery::searchExpression($expression, $type) Sets the search query expression. Parameters string $expression: A search string, which can contain keywords and options. string $type: The search type. This maps to {search_index}.type in the database. Return value $this File core/modules/search/src/SearchQuery.php, line 200 Class SearchQuery Search query extender and helper functions. Namespace Drupal\search Code public function searchExpression($expression, $type) { $this-

search_cron

search_cron() Implements hook_cron(). Fires updateIndex() in the plugins for all indexable active search pages, and cleans up dirty words. See also search_dirty() File core/modules/search/search.module, line 187 Enables site-wide keyword searching. Code function search_cron() { // We register a shutdown function to ensure that search_total is always up // to date. drupal_register_shutdown_function('search_update_totals'); /** @var $search_page_repository \Drupal\search\SearchPageRep