Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. SearchQuery.php

function SearchQuery::searchExpression

Sets the search query expression.

Parameters

string $expression: A search string, which can contain keywords and options.

string $type: The search type. This maps to {search_index}.type in the database.

Return value

$this

File

core/modules/search/src/SearchQuery.php, line 200

Class

SearchQuery
Search query extender and helper functions.

Namespace

Drupal\search

Code

public function searchExpression($expression, $type) {
    $this->searchExpression = $expression;
    $this->type = $type;
    // Add query tag.
    $this->addTag('search_' . $type);
    // Initialize conditions and status.
    $this->conditions = $this->connection
        ->condition('AND');
    $this->status = 0;
    return $this;
}
RSS feed
Powered by Drupal