search_query_extract

5 search.module search_query_extract($keys, $option)
6 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()

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];
  }
}

Comments

Drupal 7.x

In Drupal 7, the equivalent function to this is search_expression_extract()

Thank you.

Thank you.

Login or register to post comments