code: public function save($child)
      {
          /** @var ElasticsearchModel[] $children */
          $children = !is_array($child) ? [$child] : $child;
          // @TODO: use bulk if count($children) > 1
          foreach ($children as $child) {
              $child->setParent($this->parent);
              $child->save();
          }
      }
docs: Save children.
  
  @param ElasticsearchModel|ElasticsearchModel[] $child