SearchQuery::searchExpression
public function SearchQuery::searchExpression
public SearchQuery::searchExpression($expression, $module)
Sets up the search query expression.
Parameters
$query: A search query string, which can contain options.
$module: The search module. This maps to {search_index}.type in the database.
Return value
The SearchQuery object.
File
- modules/search/search.extender.inc, line 148
- Search query extender and helper functions.
Class
- SearchQuery
- Do a query on the full-text search index for a word or words.
Code
public function searchExpression($expression, $module) { $this->searchExpression = $expression; $this->type = $module; // Add a search_* tag. This needs to be added before any preExecute methods // for decorated queries are called, as $this->prepared will be set to TRUE // and tags added in the execute method will never get used. For example, // if $query is extended by 'SearchQuery' then 'PagerDefault', the // search-specific tag will be added too late (when preExecute() has // already been called from the PagerDefault extender), and as a // consequence will not be available to hook_query_alter() implementations, // nor will the correct hook_query_TAG_alter() implementations get invoked. // See node_search_execute(). $this->addTag('search_' . $module); return $this; }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!search!search.extender.inc/function/SearchQuery::searchExpression/7.x