diff --git a/src/Plugin/search_api/processor/ContentAccess.php b/src/Plugin/search_api/processor/ContentAccess.php
index 18e7f55..a7d66b3 100644
--- a/src/Plugin/search_api/processor/ContentAccess.php
+++ b/src/Plugin/search_api/processor/ContentAccess.php
@@ -174,18 +174,17 @@ class ContentAccess extends ProcessorPluginBase {
       ->filterForPropertyPath($fields, NULL, 'search_api_node_grants');
     foreach ($fields as $field) {
       // Collect grant information for the node.
-      if (!$node->access('view', $anonymous_user)) {
-        // If anonymous user has no permission we collect all grants with
-        // their realms in the item.
-        $sql = 'SELECT * FROM {node_access} WHERE (nid = 0 OR nid = :nid) AND grant_view = 1';
-        $args = [':nid' => $node->id()];
-        foreach ($this->getDatabase()->query($sql, $args) as $grant) {
+      // If there are none, use the pseudo grant 'node_access__all'.
+      $sql = 'SELECT * FROM {node_access} WHERE (nid = 0 OR nid = :nid) AND grant_view = 1';
+      $args = [':nid' => $node->id()];
+      $grant_records = $this->getDatabase()->query($sql, $args)->fetchAll();
+      if (count($grant_records) > 0) {
+        foreach ($grant_records as $grant) {
           $field->addValue("node_access_{$grant->realm}:{$grant->gid}");
         }
       }
       else {
-        // Add the generic pseudo view grant if we are not using node access
-        // or the node is viewable by anonymous users.
+        // Add the generic pseudo view grant if we are not using node access.
         $field->addValue('node_access__all');
       }
     }
