function Search::queryParseSearchExpression

Same name in this branch
  1. 10 core/modules/search/src/Plugin/views/argument/Search.php \Drupal\search\Plugin\views\argument\Search::queryParseSearchExpression()
Same name in other branches
  1. 9 core/modules/search/src/Plugin/views/filter/Search.php \Drupal\search\Plugin\views\filter\Search::queryParseSearchExpression()
  2. 9 core/modules/search/src/Plugin/views/argument/Search.php \Drupal\search\Plugin\views\argument\Search::queryParseSearchExpression()
  3. 8.9.x core/modules/search/src/Plugin/views/filter/Search.php \Drupal\search\Plugin\views\filter\Search::queryParseSearchExpression()
  4. 8.9.x core/modules/search/src/Plugin/views/argument/Search.php \Drupal\search\Plugin\views\argument\Search::queryParseSearchExpression()
  5. 11.x core/modules/search/src/Plugin/views/filter/Search.php \Drupal\search\Plugin\views\filter\Search::queryParseSearchExpression()
  6. 11.x core/modules/search/src/Plugin/views/argument/Search.php \Drupal\search\Plugin\views\argument\Search::queryParseSearchExpression()

Sets up and parses the search query.

Parameters

string $input: The search keywords entered by the user.

2 calls to Search::queryParseSearchExpression()
Search::query in core/modules/search/src/Plugin/views/filter/Search.php
Add this filter to the query.
Search::validateExposed in core/modules/search/src/Plugin/views/filter/Search.php
Validate the exposed handler form.

File

core/modules/search/src/Plugin/views/filter/Search.php, line 126

Class

Search
Filter handler for search keywords.

Namespace

Drupal\search\Plugin\views\filter

Code

protected function queryParseSearchExpression($input) {
    if (!isset($this->searchQuery)) {
        $this->parsed = TRUE;
        $this->searchQuery = \Drupal::service('database.replica')->select('search_index', 'i')
            ->extend(ViewsSearchQuery::class);
        $this->searchQuery
            ->searchExpression($input, $this->searchType);
        $this->searchQuery
            ->publicParseSearchExpression();
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.