You are here

protected function SearchApiElasticsearchConnector::isWildcardQuery in Elasticsearch Connector 7.5

Same name and namespace in other branches
  1. 7 modules/elasticsearch_connector_search_api/service.inc \SearchApiElasticsearchConnector::isWildcardQuery()
  2. 7.2 modules/elasticsearch_connector_search_api/service.inc \SearchApiElasticsearchConnector::isWildcardQuery()

Check if the query has a wildcard parameter or not.

Parameters

SearchApiQueryInterface $query:

Return value

boolean

2 calls to SearchApiElasticsearchConnector::isWildcardQuery()
SearchApiElasticsearchConnector::handleFulltextSearch in modules/elasticsearch_connector_search_api/service.inc
Helper function. Handle freetext search parameters.
SearchApiElasticsearchConnector::handleStringQuery in modules/elasticsearch_connector_search_api/service.inc
Build the string_query for the Elasticsearch request.

File

modules/elasticsearch_connector_search_api/service.inc, line 1527
Provides a Elasticsearch-based service class for the Search API using Elasticsearch Connector module.

Class

SearchApiElasticsearchConnector
Search service class.

Code

protected function isWildcardQuery(SearchApiQueryInterface $query) {
  $return = FALSE;
  $originalKeys = $query
    ->getOriginalKeys();
  if (!empty($originalKeys) && preg_match('/\\*|\\?/', $originalKeys)) {
    $return = TRUE;
  }
  return $return;
}