4 class Database_Adapter_Elasticsearch_Setup implements Database_ISetup
6 public function __construct()
8 $this->searchInstance = $GLOBALS['phorkie']['cfg']['elasticsearch'];
11 public function setup()
13 $r = new \HTTP_Request2(
14 $this->searchInstance . '/_mapping', \HTTP_Request2::METHOD_GET
17 if ($res->getStatus() == 404) {
22 public function reset()
24 $r = new \HTTP_Request2(
25 $this->searchInstance,
26 \HTTP_Request2::METHOD_DELETE
30 $r = new Database_Adapter_Elasticsearch_HTTPRequest(
31 $this->searchInstance,
32 \HTTP_Request2::METHOD_PUT
37 $r = new Database_Adapter_Elasticsearch_HTTPRequest(
38 $this->searchInstance . 'file/_mapping',
39 \HTTP_Request2::METHOD_PUT
44 'file' => (object)array(
45 '_parent' => (object)array(
48 'properties' => (object)array(
49 'name' => (object)array(
53 'extension' => (object)array(
57 'content' => (object)array(
69 //mapping for repositories
70 $r = new Database_Adapter_Elasticsearch_HTTPRequest(
71 $this->searchInstance . 'repo/_mapping',
72 \HTTP_Request2::METHOD_PUT
77 'repo' => (object)array(
78 '_timestamp' => (object)array(
82 'properties' => (object)array(
83 'id' => (object)array(
86 'description' => (object)array(
90 'crdate' => (object)array(
94 'modate' => (object)array(
98 'tstamp' => (object)array(