diff --git a/core/modules/views/src/Plugin/views/display/EntityReference.php b/core/modules/views/src/Plugin/views/display/EntityReference.php
index de2c085..38d8f29 100644
--- a/core/modules/views/src/Plugin/views/display/EntityReference.php
+++ b/core/modules/views/src/Plugin/views/display/EntityReference.php
@@ -138,7 +138,8 @@ public function query() {
       foreach ($style_options['options']['search_fields'] as $field_id) {
         if (!empty($field_id)) {
           // Get the table and field names for the checked field.
-          $field_alias = $this->view->query->addField($this->view->field[$field_id]->table, $field_id);
+          $field_handler = $this->view->field[$field_id];
+          $field_alias = $this->view->query->addField($field_handler->table, $field_handler->realField);
           $field = $this->view->query->fields[$field_alias];
           // Add an OR condition for the field.
           $conditions->condition($field['table'] . '.' . $field['field'], $value, 'LIKE');
diff --git a/core/modules/views/src/Tests/Plugin/DisplayEntityReferenceTest.php b/core/modules/views/src/Tests/Plugin/DisplayEntityReferenceTest.php
new file mode 100644
index 0000000..256767c
--- /dev/null
+++ b/core/modules/views/src/Tests/Plugin/DisplayEntityReferenceTest.php
@@ -0,0 +1,142 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\views\Tests\Plugin\DisplayEntityReferenceTest.
+ */
+
+namespace Drupal\views\Tests\Plugin;
+
+use Drupal\field\Entity\FieldConfig;
+use Drupal\field\Entity\FieldStorageConfig;
+use Drupal\views\Views;
+
+/**
+ * Tests the entity reference display plugin.
+ *
+ * @group views
+ *
+ * @see \Drupal\views\Plugin\views\display\EntityReference
+ */
+class DisplayEntityReferenceTest extends PluginTestBase {
+
+  /**
+   * Views used by this test.
+   *
+   * @var array
+   */
+  public static $testViews = array('test_display_entity_reference');
+
+  /**
+   * Modules to enable.
+   *
+   * @var array
+   */
+  public static $modules = array('node', 'field', 'views_ui');
+
+  /**
+   * The page node type.
+   *
+   * @var \Drupal\node\NodeTypeInterface
+   */
+  protected $nodeType;
+
+  /**
+   * The used field name in the test.
+   *
+   * @var string
+   */
+  protected $fieldName;
+
+  /**
+   * The field storage.
+   *
+   * @var \Drupal\field\Entity\FieldStorageConfig
+   */
+  protected $fieldStorage;
+
+  /**
+   * The field config.
+   *
+   * @var \Drupal\field\Entity\FieldConfig
+   */
+  protected $field;
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function setUp() {
+    parent::setUp();
+    $this->drupalLogin($this->drupalCreateUser(array('administer views')));
+
+    // Create content type with a text field.
+    $this->nodeType = $this->drupalCreateContentType(['type' => 'page', 'name' => 'Basic page']);
+
+    // Create the unlimited text field.
+    $this->fieldName = 'field_test_entity_ref_display';
+    $this->fieldStorage = FieldStorageConfig::create([
+      'field_name' => $this->fieldName,
+      'entity_type' => 'node',
+      'type' => 'text',
+    ]);
+    $this->fieldStorage->save();
+
+    // Create an instance of the text field on the content type.
+    $this->field = FieldConfig::create([
+      'field_storage' => $this->fieldStorage,
+      'bundle' => $this->nodeType->id(),
+    ]);
+    $this->field->save();
+
+    // Create some nodes to search. Add a common string to the title and
+    // the text field in two nodes so we can test that we can search in both.
+    for ($i = 0; $i < 5; $i++) {
+      $edit = [
+        'title' => 'title' . $i,
+        $this->fieldName => 'text',
+      ];
+      $this->drupalCreateNode($edit);
+      $edit = [
+        'title' => 'title',
+        $this->fieldName => 'text' . $i,
+      ];
+      $this->drupalCreateNode($edit);
+    }
+  }
+
+  /**
+   * Tests the entity reference display plugin.
+   */
+  public function testEntityReferenceDisplay() {
+    // Add the new field to the fields.
+    $this->drupalPostForm('admin/structure/views/nojs/add-handler/test_display_entity_reference/default/field', ['name[node__' . $this->fieldName . '.' . $this->fieldName . ']' => TRUE], t('Add and configure fields'));
+    $this->drupalPostForm(NULL, [], t('Apply'));
+
+    // Test that the right fields are shown on the display settings form.
+    $this->drupalGet('admin/structure/views/nojs/display/test_display_entity_reference/entity_reference_1/style_options');
+    $this->assertText('Content: Title');
+    $this->assertText('Content: ' . $this->field->label());
+
+    // Add the new field to the search fields.
+    $this->drupalPostForm(NULL, ['style_options[search_fields][' . $this->fieldName . ']' => $this->fieldName], t('Apply'));
+    $this->drupalPostForm(NULL, [], t('Save'));
+
+    $view = Views::getView('test_display_entity_reference');
+    $view->setDisplay('entity_reference_1');
+
+    // Add the required settings to test a search operation.
+    $options = [
+      'match' => '1',
+      'match_operator' => 'CONTAINS',
+      'limit' => 0,
+      'ids' => NULL,
+    ];
+    $view->display_handler->setOption('entity_reference_options', $options);
+
+    $this->executeView($view);
+
+    // Test that we have searched in both fields.
+    $this->assertEqual(count($view->result), 2, 'Search returned two rows');
+  }
+
+}
diff --git a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_display_entity_reference.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_display_entity_reference.yml
new file mode 100644
index 0000000..54747c6
--- /dev/null
+++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_display_entity_reference.yml
@@ -0,0 +1,173 @@
+langcode: en
+status: true
+dependencies:
+  module:
+    - node
+id: test_display_entity_reference
+label: test_display_entity_reference
+module: views
+description: ''
+tag: ''
+base_table: node_field_data
+base_field: nid
+core: 8.x
+display:
+  default:
+    display_plugin: default
+    id: default
+    display_title: Master
+    position: 0
+    display_options:
+      access:
+        type: none
+        options: {  }
+      cache:
+        type: tag
+        options: {  }
+      query:
+        type: views_query
+        options:
+          disable_sql_rewrite: false
+          distinct: false
+          replica: false
+          query_comment: ''
+          query_tags: {  }
+      exposed_form:
+        type: basic
+        options:
+          submit_button: Apply
+          reset_button: false
+          reset_button_label: Reset
+          exposed_sorts_label: 'Sort by'
+          expose_sort_order: true
+          sort_asc_label: Asc
+          sort_desc_label: Desc
+      pager:
+        type: full
+        options:
+          items_per_page: 10
+          offset: 0
+          id: 0
+          total_pages: null
+          expose:
+            items_per_page: false
+            items_per_page_label: 'Items per page'
+            items_per_page_options: '5, 10, 25, 50'
+            items_per_page_options_all: false
+            items_per_page_options_all_label: '- All -'
+            offset: false
+            offset_label: Offset
+          tags:
+            previous: '‹ Previous'
+            next: 'Next ›'
+            first: '« First'
+            last: 'Last »'
+          quantity: 9
+      style:
+        type: default
+        options:
+          grouping: {  }
+          row_class: ''
+          default_row_class: true
+          uses_fields: false
+      row:
+        type: fields
+        options:
+          inline: {  }
+          separator: ''
+          hide_empty: false
+          default_field_elements: true
+      fields:
+        title:
+          id: title
+          table: node_field_data
+          field: title
+          entity_type: node
+          entity_field: title
+          label: ''
+          alter:
+            alter_text: false
+            make_link: false
+            absolute: false
+            trim: false
+            word_boundary: false
+            ellipsis: false
+            strip_tags: false
+            html: false
+          hide_empty: false
+          empty_zero: false
+          settings:
+            link_to_entity: true
+          plugin_id: field
+          relationship: none
+          group_type: group
+          admin_label: ''
+          exclude: false
+          element_type: ''
+          element_class: ''
+          element_label_type: ''
+          element_label_class: ''
+          element_label_colon: true
+          element_wrapper_type: ''
+          element_wrapper_class: ''
+          element_default_classes: true
+          empty: ''
+          hide_alter_empty: true
+          click_sort_column: value
+          type: string
+          group_column: value
+          group_columns: {  }
+          group_rows: true
+          delta_limit: 0
+          delta_offset: 0
+          delta_reversed: false
+          delta_first_last: false
+          multi_type: separator
+          separator: ', '
+          field_api_classes: false
+      filters:
+        status:
+          value: true
+          table: node_field_data
+          field: status
+          plugin_id: boolean
+          entity_type: node
+          entity_field: status
+          id: status
+          expose:
+            operator: ''
+          group: 1
+      sorts: {  }
+      header: {  }
+      footer: {  }
+      empty: {  }
+      relationships: {  }
+      arguments: {  }
+      display_extenders: {  }
+    cache_metadata:
+      max-age: -1
+      contexts:
+        - 'languages:language_content'
+        - 'languages:language_interface'
+        - url.query_args
+        - 'user.node_grants:view'
+      tags: {  }
+  entity_reference_1:
+    display_plugin: entity_reference
+    id: entity_reference_1
+    display_title: 'Entity Reference'
+    position: 1
+    display_options:
+      display_extenders: {  }
+      style:
+        type: entity_reference
+        options:
+          search_fields:
+            title: title
+    cache_metadata:
+      max-age: -1
+      contexts:
+        - 'languages:language_content'
+        - 'languages:language_interface'
+        - 'user.node_grants:view'
+      tags: {  }
