You are here

function search_query_extract in Drupal 6

Same name and namespace in other branches
  1. 4 modules/search.module \search_query_extract()
  2. 5 modules/search/search.module \search_query_extract()

Extract a module-specific search option from a search query. e.g. 'type:book'

2 calls to search_query_extract()
node_search in modules/node/node.module
Implementation of hook_search().
search_query_insert in modules/search/search.module
Return a query with the given module-specific search option inserted in. e.g. 'type:book'.

File

modules/search/search.module, line 670
Enables site-wide keyword searching.

Code

function search_query_extract($keys, $option) {
  if (preg_match('/(^| )' . $option . ':([^ ]*)( |$)/i', $keys, $matches)) {
    return $matches[2];
  }
}