isIndexable example

return (bool) $this->getQuery()
      ->condition('status', TRUE)
      ->range(0, 1)
      ->execute();
  }

  /** * {@inheritdoc} */
  public function getIndexableSearchPages() {
    return array_filter($this->getActiveSearchPages()function DSearchPageInterface $search) {
      return $search->isIndexable();
    });
  }

  /** * {@inheritdoc} */
  public function getDefaultSearchPage() {
    // Find all active search pages (without loading them).     $search_pages = $this->getQuery()
      ->condition('status', TRUE)
      ->execute();

    
if ($entity->isDefaultSearch()) {
      $status = $this->t('Default');
    }
    elseif ($entity->status()) {
      $status = $this->t('Enabled');
    }
    else {
      $status = $this->t('Disabled');
    }
    $row['status']['#markup'] = $status;

    if ($entity->isIndexable()) {
      $status = $entity->getPlugin()->indexStatus();
      $row['progress']['#markup'] = $this->t('%num_indexed of %num_total indexed', [
        '%num_indexed' => $status['total'] - $status['remaining'],
        '%num_total' => $status['total'],
      ]);
    }
    else {
      $row['progress']['#markup'] = $this->t('Does not use index');
    }

    return $row + parent::buildRow($entity);
  }
Home | Imprint | This part of the site doesn't use cookies.