You are here

public function ContentHubSearch::buildElasticSearchQuery in Acquia Content Hub 8

Executes and ES query for a given asset uuid.

Parameters

array $conditions: List of filter conditions.

string $asset_uuid: The Asset Uuid that arrived through a webhook.

string $asset_type: The Asset Type (entity_type_id).

Return value

bool Returns query result.

File

src/ContentHubSearch.php, line 338

Class

ContentHubSearch
Perform queries to the Content Hub "_search" endpoint [Elasticsearch].

Namespace

Drupal\acquia_contenthub

Code

public function buildElasticSearchQuery(array $conditions, $asset_uuid, $asset_type) {
  $result = $this
    ->getElasticSearchQueryResponse($conditions, $asset_uuid, $asset_type);
  if ($result & !empty($result['total'])) {
    return $result['total'];
  }
  return 0;
}