public function schema() { if ($this->schema !== null) { return $this->schema; } $name = $this->name(); $type = $this->connection()->getIndex()->getType($name); $this->schema = new MappingSchema($name, $type->getMapping()); return $this->schema; }