diff --git a/src/Form/IndexAddFieldsForm.php b/src/Form/IndexAddFieldsForm.php
index 61f4be2..7bb6f05 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;
@@ -368,7 +369,16 @@ class IndexAddFieldsForm extends EntityForm {
       $parent_child_type = NULL;
       if ($property instanceof ComplexDataDefinitionInterface) {
         $can_be_indexed = FALSE;
-        $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;
+          }
+        }
+        else {
+          $nested_properties = $property->getPropertyDefinitions();
+        }
         $main_property = $property->getMainPropertyName();
         if ($main_property && isset($nested_properties[$main_property])) {
           $parent_child_type = $property->getDataType() . '.';
diff --git a/src/Item/Field.php b/src/Item/Field.php
index 8580c59..923c4f9 100644
--- a/src/Item/Field.php
+++ b/src/Item/Field.php
@@ -377,7 +377,16 @@ class Field implements \IteratorAggregate, FieldInterface {
     if (!$property instanceof ComplexDataDefinitionInterface) {
       return NULL;
     }
-    return $this->getNestedDefinition($property->getPropertyDefinitions(), $keys);
+    $nested_properties = $property->getPropertyDefinitions();
+    // If we have a bundle we need the fields of the bundle.
+    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 $this->getNestedDefinition($nested_properties, $keys);
   }
 
   /**
