public function setup()
{
+ $r = new Database_Adapter_Elasticsearch_HTTPRequest(
+ $this->searchInstance . 'repo/_mapping',
+ \HTTP_Request2::METHOD_DELETE
+ );
+ $r->send();
+
//create mapping
//mapping for repositories
- $r = new \HTTP_Request2(
+ $r = new Database_Adapter_Elasticsearch_HTTPRequest(
$this->searchInstance . 'repo/_mapping',
\HTTP_Request2::METHOD_PUT
);
json_encode(
(object)array(
'repo' => (object)array(
+ '_timestamp' => (object)array(
+ 'enabled' => true,
+ 'path' => 'tstamp',
+ ),
'properties' => (object)array(
'id' => (object)array(
'type' => 'long'
'description' => (object)array(
'type' => 'string',
'boost' => 2.0
+ ),
+ 'crdate' => (object)array(
+ //creation date
+ 'type' => 'date',
+ ),
+ 'tstamp' => (object)array(
+ //modification date
+ 'type' => 'date',
)
)
)
$r->send();
//mapping for files
- $r = new \HTTP_Request2(
+ $r = new Database_Adapter_Elasticsearch_HTTPRequest(
$this->searchInstance . 'file/_mapping',
\HTTP_Request2::METHOD_PUT
);