public function action($actionType, $data = [])
    {

        $this->body["body"][] = [

            $actionType => [
                '_index' => $this->getIndex(),
                '_type' => $this->getType(),
                '_id' => $this->_id
            ]

        ];

        if (!empty($data)) {
            if($actionType == "update"){
                $this->body["body"][] = ["doc" => $data];
            }else {
                $this->body["body"][] = $data;
            }
        }

        $this->operationCount++;

        $this->reset();

        if ($this->autocommitAfter > 0 && $this->operationCount >= $this->autocommitAfter) {
            return $this->commit();
        }

        return true;
    }