/** * @param $name * @param $pattern * @param $settings * @param $mappings * @param integer $order * @return mixed * @see http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html */ public function createTemplate($name, $pattern, $settings, $mappings, $order = 0) { $body = Json::encode(['template' => $pattern, 'order' => $order, 'settings' => (object) $settings, 'mappings' => (object) $mappings]); return $this->db->put(['_template', $name], [], $body); }