function search_query_insert in Drupal 4
Same name and namespace in other branches
- 5 modules/search/search.module \search_query_insert()
- 6 modules/search/search.module \search_query_insert()
Return a query with the given module-specific search option inserted in. e.g. 'type:book'.
2 calls to search_query_insert()
- node_search in modules/
node.module - Implementation of hook_search().
- node_search_validate in modules/
node.module - Form API callback for the search form. Registered in node_form_alter().
File
- modules/
search.module, line 623 - 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;
}