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 //mapping for repositories
38 $r = new Database_Adapter_Elasticsearch_HTTPRequest(
39 $this->searchInstance . 'repo/_mapping',
40 \HTTP_Request2::METHOD_PUT
45 'repo' => (object)array(
46 '_timestamp' => (object)array(
50 'properties' => (object)array(
51 'id' => (object)array(
54 'description' => (object)array(
58 'crdate' => (object)array(
62 'modate' => (object)array(
66 'tstamp' => (object)array(
78 $r = new Database_Adapter_Elasticsearch_HTTPRequest(
79 $this->searchInstance . 'file/_mapping',
80 \HTTP_Request2::METHOD_PUT
85 'file' => (object)array(
86 '_parent' => (object)array(
89 'properties' => (object)array(
90 'name' => (object)array(
94 'extension' => (object)array(
98 'content' => (object)array(