aboutsummaryrefslogtreecommitdiff
path: root/src/phorkie/Database/Adapter/Elasticsearch/Setup.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/phorkie/Database/Adapter/Elasticsearch/Setup.php')
-rw-r--r--src/phorkie/Database/Adapter/Elasticsearch/Setup.php66
1 files changed, 33 insertions, 33 deletions
diff --git a/src/phorkie/Database/Adapter/Elasticsearch/Setup.php b/src/phorkie/Database/Adapter/Elasticsearch/Setup.php
index bb76d54..1e632ba 100644
--- a/src/phorkie/Database/Adapter/Elasticsearch/Setup.php
+++ b/src/phorkie/Database/Adapter/Elasticsearch/Setup.php
@@ -33,6 +33,38 @@ class Database_Adapter_Elasticsearch_Setup implements Database_ISetup
);
$r->send();
+ //mapping for files
+ $r = new Database_Adapter_Elasticsearch_HTTPRequest(
+ $this->searchInstance . 'file/_mapping',
+ \HTTP_Request2::METHOD_PUT
+ );
+ $r->setBody(
+ json_encode(
+ (object)array(
+ 'file' => (object)array(
+ '_parent' => (object)array(
+ 'type' => 'repo'
+ ),
+ 'properties' => (object)array(
+ 'name' => (object)array(
+ 'type' => 'string',
+ 'boost' => 1.5
+ ),
+ 'extension' => (object)array(
+ 'type' => 'string',
+ 'boost' => 1.0
+ ),
+ 'content' => (object)array(
+ 'type' => 'string',
+ 'boost' => 0.8
+ )
+ )
+ )
+ )
+ )
+ );
+ $r->send();
+
//create mapping
//mapping for repositories
$r = new Database_Adapter_Elasticsearch_HTTPRequest(
@@ -45,7 +77,7 @@ class Database_Adapter_Elasticsearch_Setup implements Database_ISetup
'repo' => (object)array(
'_timestamp' => (object)array(
'enabled' => true,
- 'path' => 'tstamp',
+ //'path' => 'tstamp',
),
'properties' => (object)array(
'id' => (object)array(
@@ -73,38 +105,6 @@ class Database_Adapter_Elasticsearch_Setup implements Database_ISetup
)
);
$r->send();
-
- //mapping for files
- $r = new Database_Adapter_Elasticsearch_HTTPRequest(
- $this->searchInstance . 'file/_mapping',
- \HTTP_Request2::METHOD_PUT
- );
- $r->setBody(
- json_encode(
- (object)array(
- 'file' => (object)array(
- '_parent' => (object)array(
- 'type' => 'repo'
- ),
- 'properties' => (object)array(
- 'name' => (object)array(
- 'type' => 'string',
- 'boost' => 1.5
- ),
- 'extension' => (object)array(
- 'type' => 'string',
- 'boost' => 1.0
- ),
- 'content' => (object)array(
- 'type' => 'string',
- 'boost' => 0.8
- )
- )
- )
- )
- )
- );
- $r->send();
}
}