Requires the delete-by-query plugin for elasticsearch.
It is used to provide search capabilities and the list of recent pastes.
It is used to provide search capabilities and the list of recent pastes.
-Elasticsearch version 1.3 is supported.
+Elasticsearch version 2.0 is supported.
+
+You have to install the `delete-by-query`__ plugin::
+
+ $ cd /usr/share/elasticsearch
+ $ bin/plugin install delete-by-query
__ http://www.elasticsearch.org/
__ http://www.elasticsearch.org/
+__ https://www.elastic.co/guide/en/elasticsearch/plugins/2.0/plugins-delete-by-query.html
}
$js = json_decode($res->getBody());
if (isset($js->error)) {
}
$js = json_decode($res->getBody());
if (isset($js->error)) {
+ $error = json_encode($js->error);
} else {
$error = $res->getBody();
}
} else {
$error = $res->getBody();
}
+ //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(
//create mapping
//mapping for repositories
$r = new Database_Adapter_Elasticsearch_HTTPRequest(
'repo' => (object)array(
'_timestamp' => (object)array(
'enabled' => true,
'repo' => (object)array(
'_timestamp' => (object)array(
'enabled' => true,
),
'properties' => (object)array(
'id' => (object)array(
),
'properties' => (object)array(
'id' => (object)array(
-
- //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();