function search_query_insert

6.x search.module search_query_insert($keys, $option, $value = '')

Return a query with the given module-specific search option inserted in. e.g. 'type:book'.

3 calls to search_query_insert()
hook_search in documentation-6.x/developer/hooks/core.php
Define a custom search routine.
node_search in drupal-6.x/modules/node/node.module
Implementation of hook_search().
node_search_validate in drupal-6.x/modules/node/node.module
Form API callback for the search form. Registered in node_form_alter().

File

drupal-6.x/modules/search/search.module, line 680
Enables site-wide keyword searching.

Code

function search_query_insert($keys, $option, $value = '') {
  if (search_query_extract($keys, $option)) {
    $keys = trim(preg_replace('/(^| )' . $option . ':[^ ]*/i', '', $keys));
  }
  if ($value != '') {
    $keys .= ' ' . $option . ':' . $value;
  }
  return $keys;
}