You are here

public function AcquiaSearchSolrPreferredIndex::getPreferredIndex in Acquia Connector 7.3

Returns the preferred index from the list of available search indexes.

Return value

array|null NULL or [ 'host' => 'useast11-c4.acquia-search.com', 'index_id' => 'WXYZ-12345.dev.mysitedev', ].

2 calls to AcquiaSearchSolrPreferredIndex::getPreferredIndex()
AcquiaSearchSolrPreferredIndex::getPreferredIndexUrl in acquia_search/includes/AcquiaSearchSolrPreferredIndex.php
Returns preferred index url.
AcquiaSearchSolrPreferredIndex::isPreferredIndexAvailable in acquia_search/includes/AcquiaSearchSolrPreferredIndex.php
Determines whether the expected index ID matches any available indexes IDs.

File

acquia_search/includes/AcquiaSearchSolrPreferredIndex.php, line 97

Class

AcquiaSearchSolrPreferredIndex
Class AcquiaSearchSolrPreferredIndex.

Code

public function getPreferredIndex() {
  $possibleIndexes = $this
    ->getListOfPossibleIndexes();
  foreach ($possibleIndexes as $possibleIndex) {
    foreach ($this->availableIndexes as $availableIndex) {
      if ($possibleIndex === $availableIndex['index_id']) {
        return $availableIndex;
      }
    }
  }
  return NULL;
}