diff --git a/core/modules/search/lib/Drupal/search/Tests/SearchNodeAccessTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchNodeAccessTest.php
new file mode 100644
index 0000000..a007fd6
--- /dev/null
+++ b/core/modules/search/lib/Drupal/search/Tests/SearchNodeAccessTest.php
@@ -0,0 +1,94 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\search\Tests\SearchNodeAccessTest.
+ */
+
+namespace Drupal\search\Tests;
+
+/**
+ * Tests searching with a node access module enabled.
+ */
+class SearchNodeAccessTest extends SearchTestBase {
+
+  /**
+   * Modules to enable.
+   *
+   * @var array
+   */
+  public static $modules = array('node', 'search', 'node_access_test');
+
+  public static function getInfo() {
+    return array(
+      'name' => 'Node access',
+      'description' => 'Tests searching with a node access module enabled',
+      'group' => 'Search',
+    );
+  }
+
+  function setUp() {
+    parent::setUp();
+
+    node_access_rebuild();
+    \Drupal::state()->set('node_access_test.private', TRUE);
+  }
+
+  /**
+   * Tests that searching works with a node access module.
+   */
+  function testSearchNodeAccess() {
+
+    // The node access module allows users to create "private" nodes that only
+    // they can see. So, create one public node, and then create two users, and
+    // have one of them create a private node. Make sure they all have the same
+    // node body. Create them by visiting the node/add page.
+
+    $user1 = $this->drupalCreateUser(array('access content', 'create article content', 'search content'));
+    $user2 = $this->drupalCreateUser(array('access content', 'create article content', 'search content'));
+
+    $body = 'common node body';
+    $private_title = 'Private node';
+    $public_title = 'Public node';
+
+    $this->drupalLogin($user1);
+    $edit = array(
+      'title[0][value]' => $private_title,
+      'private' => TRUE,
+      'body[0][value]' => $body,
+    );
+    $this->drupalPostForm('node/add/article', $edit, t('Save'));
+
+    $edit = array(
+      'title[0][value]' => $public_title,
+      'body[0][value]' => $body,
+    );
+    $this->drupalPostForm('node/add/article', $edit, t('Save'));
+
+    // Run the index update and shutdown process to index the content.
+    $this->container->get('plugin.manager.search')->createInstance('node_search')->updateIndex();
+    search_update_totals();
+
+    // Still logged in as user 1, search using a keyword and an AND and verify
+    // that both public and private nodes are found.
+    $this->drupalPostForm('search/node', array('keys' => 'common'), t('Search'));
+    $this->assertLink($private_title, 0, 'Private node is found by owner with simple keyword search');
+    $this->assertLink($public_title, 0, 'Public node is found with simple keyword search');
+
+    $this->drupalPostForm('search/node', array('keys' => 'common body'), t('Search'));
+    $this->assertLink($private_title, 0, 'Private node is found by owner with AND keyword search');
+    $this->assertLink($public_title, 0, 'Public node is found with AND keyword search');
+
+    // Now log in as user 2 and do the same searches. Private node should not
+    // be found.
+    $this->drupalLogin($user2);
+    $this->drupalPostForm('search/node', array('keys' => 'common'), t('Search'));
+    $this->assertNoLink($private_title, 'Private node is not found by non-owner with simple keyword search');
+    $this->assertLink($public_title, 0, 'Public node is found with simple keyword search');
+
+    $this->drupalPostForm('search/node', array('keys' => 'common body'), t('Search'));
+    $this->assertNoLink($private_title, 'Private node is not found by non-owner with AND keyword search');
+    $this->assertLink($public_title, 0, 'Public node is found with AND keyword search');
+
+  }
+}
