function search_query_extract

6.x search.module search_query_extract($keys, $option)

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

3 calls to search_query_extract()
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().
search_query_insert in drupal-6.x/modules/search/search.module
Return a query with the given module-specific search option inserted in. e.g. 'type:book'.

File

drupal-6.x/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];
  }
}