diff --git a/src/Form/IndexAddFieldsForm.php b/src/Form/IndexAddFieldsForm.php
index 61f4be2..69c91c0 100644
--- a/src/Form/IndexAddFieldsForm.php
+++ b/src/Form/IndexAddFieldsForm.php
@@ -12,6 +12,7 @@ use Drupal\Component\Utility\Html;
 use Drupal\Core\Datetime\DateFormatter;
 use Drupal\Core\Entity\EntityForm;
 use Drupal\Core\Entity\EntityTypeManagerInterface;
+use Drupal\Core\Entity\TypedData\EntityDataDefinitionInterface;
 use Drupal\Core\Field\TypedData\FieldItemDataDefinition;
 use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Render\RendererInterface;
@@ -225,8 +226,8 @@ class IndexAddFieldsForm extends EntityForm {
             'class' => array(
               'index-locked',
               'messages',
-              'messages--warning'
-            )
+              'messages--warning',
+            ),
           ),
           '#children' => $this->t('This index is being edited by user @user, and is therefore locked from editing by others. This lock is @age old. Click here to <a href=":url">break this lock</a>.', $lock_message_substitutions),
           '#weight' => -10,
@@ -368,7 +369,7 @@ class IndexAddFieldsForm extends EntityForm {
       $parent_child_type = NULL;
       if ($property instanceof ComplexDataDefinitionInterface) {
         $can_be_indexed = FALSE;
-        $nested_properties = $property->getPropertyDefinitions();
+        $nested_properties = Utility::getNestedProperties($property);
         $main_property = $property->getMainPropertyName();
         if ($main_property && isset($nested_properties[$main_property])) {
           $parent_child_type = $property->getDataType() . '.';
@@ -380,7 +381,12 @@ class IndexAddFieldsForm extends EntityForm {
 
         // Don't add the additional 'entity' property for entity reference
         // fields which don't target a content entity type.
-        if ($property instanceof FieldItemDataDefinition && in_array($property->getDataType(), array('field_item:entity_reference', 'field_item:image', 'field_item:file'))) {
+        if ($property instanceof FieldItemDataDefinition && in_array($property->getDataType(), array(
+            'field_item:entity_reference',
+            'field_item:image',
+            'field_item:file',
+          ))
+        ) {
           $entity_type = $this->getEntityTypeManager()
             ->getDefinition($property->getSetting('target_type'));
           if (!$entity_type->isSubclassOf('Drupal\Core\Entity\ContentEntityInterface')) {
diff --git a/src/Item/Field.php b/src/Item/Field.php
index 8580c59..be2b20e 100644
--- a/src/Item/Field.php
+++ b/src/Item/Field.php
@@ -377,7 +377,8 @@ class Field implements \IteratorAggregate, FieldInterface {
     if (!$property instanceof ComplexDataDefinitionInterface) {
       return NULL;
     }
-    return $this->getNestedDefinition($property->getPropertyDefinitions(), $keys);
+    $nested_properties = Utility::getNestedProperties($property);
+    return $this->getNestedDefinition($nested_properties, $keys);
   }
 
   /**
diff --git a/src/Utility.php b/src/Utility.php
index 460c3c1..92392f8 100644
--- a/src/Utility.php
+++ b/src/Utility.php
@@ -10,6 +10,7 @@ namespace Drupal\search_api;
 use Drupal\Component\Render\FormattableMarkup;
 use Drupal\Core\Config\ConfigImporter;
 use Drupal\Core\Entity\EntityInterface;
+use Drupal\Core\Entity\TypedData\EntityDataDefinitionInterface;
 use Drupal\Core\TypedData\ComplexDataDefinitionInterface;
 use Drupal\Core\TypedData\ComplexDataInterface;
 use Drupal\Core\TypedData\DataDefinitionInterface;
@@ -749,4 +750,28 @@ class Utility {
     return static::splitPropertyPath($combined_id, TRUE, IndexInterface::DATASOURCE_ID_SEPARATOR);
   }
 
+  /**
+   * Get nested properties.
+   *
+   * If we have bundles, we have to arrive up to the fields that are in the
+   * bundle.
+   *
+   * @param \Drupal\Core\TypedData\DataDefinitionInterface[] $property
+   *   The base definition.
+   *
+   * @return \Drupal\Core\Field\FieldDefinitionInterface[]
+   *   The nested properties and fields of the entity.
+   */
+  public static function getNestedProperties($property) {
+    $nested_properties = $property->getPropertyDefinitions();
+    if ($property instanceof EntityDataDefinitionInterface) {
+      $bundles = \Drupal::entityManager()->getBundleInfo($property->getEntityTypeId());
+      foreach ($bundles as $bundle => $bundle_label) {
+        $bundle_properties = \Drupal::entityManager()->getFieldDefinitions($property->getEntityTypeId(), $bundle);
+        $nested_properties += $bundle_properties;
+      }
+    }
+    return $nested_properties;
+  }
+
 }
