Skip to content

Commit

Permalink
switched to ES6 (#59)
Browse files Browse the repository at this point in the history
* switched to ES6

* switched to ES6
  • Loading branch information
fashxp authored Sep 16, 2019
1 parent d25f144 commit 39fa64d
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 27 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Advanced Object Search via Elasticsearch

Advanced Object Search bundle provides advanced object search in
Pimcore backend powered by Elasticsearch.
Pimcore backend powered by Elasticsearch v6.

## Integration into Pimcore

Expand Down Expand Up @@ -204,3 +204,7 @@ with Pimcore < 5.4, please add following rewrite rule to your `.htaccess`.
# rewrite rule for pre pimcore 5.4 core static files
RewriteRule ^bundles/pimcoreadmin/(.*) /pimcore/static6/$1 [PT,L]
```
## Supported Elastic Search Versions
- ElasticSearch 6
12 changes: 6 additions & 6 deletions src/Filter/FieldDefinitionAdapter/DefaultAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,15 @@ public function getESMapping() {
[
'properties' => [
self::ES_MAPPING_PROPERTY_STANDARD => [
'type' => 'string',
'type' => 'text',
'fields' => [
"raw" => [ "type" => "string", "index" => "not_analyzed" ]
'raw' => [ 'type' => 'keyword' ]
]
],
self::ES_MAPPING_PROPERTY_NOT_INHERITED => [
'type' => 'string',
'type' => 'text',
'fields' => [
"raw" => [ "type" => "string", "index" => "not_analyzed" ]
'raw' => [ 'type' => 'keyword' ]
]
]
]
Expand All @@ -102,9 +102,9 @@ public function getESMapping() {
return [
$this->fieldDefinition->getName(),
[
'type' => 'string',
'type' => 'text',
'fields' => [
"raw" => [ "type" => "string", "index" => "not_analyzed" ]
'raw' => [ 'type' => 'keyword' ]
]
]
];
Expand Down
12 changes: 6 additions & 6 deletions src/Filter/FieldDefinitionAdapter/ManyToOneRelation.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,16 @@ public function getESMapping() {
self::ES_MAPPING_PROPERTY_STANDARD => [
'type' => 'nested',
'properties' => [
'type' => ["type" => "string", "index" => "not_analyzed"],
'subtype' => ["type" => "string", "index" => "not_analyzed"],
'type' => ['type' => 'keyword'],
'subtype' => ['type' => 'keyword'],
'id' => ["type" => "long"]
]
],
self::ES_MAPPING_PROPERTY_NOT_INHERITED => [
'type' => 'nested',
'properties' => [
'type' => ["type" => "string", "index" => "not_analyzed"],
'subtype' => ["type" => "string", "index" => "not_analyzed"],
'type' => ['type' => 'keyword'],
'subtype' => ['type' => 'keyword'],
'id' => ["type" => "long"]
]
]
Expand All @@ -68,8 +68,8 @@ public function getESMapping() {
[
'type' => 'nested',
'properties' => [
'type' => ["type" => "string", "index" => "not_analyzed"],
'subtype' => ["type" => "string", "index" => "not_analyzed"],
'type' => ['type' => 'keyword'],
'subtype' => ['type' => 'keyword'],
'id' => ["type" => "long"]
]
]
Expand Down
13 changes: 3 additions & 10 deletions src/Filter/FieldDefinitionAdapter/Select.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,16 @@ public function getESMapping() {
$this->fieldDefinition->getName(),
[
'properties' => [
self::ES_MAPPING_PROPERTY_STANDARD => [
'type' => 'string',
'index' => 'not_analyzed'
],
self::ES_MAPPING_PROPERTY_NOT_INHERITED => [
'type' => 'string',
'index' => 'not_analyzed'
]
self::ES_MAPPING_PROPERTY_STANDARD => ['type' => 'keyword'],
self::ES_MAPPING_PROPERTY_NOT_INHERITED => ['type' => 'keyword']
]
]
];
} else {
return [
$this->fieldDefinition->getName(),
[
'type' => 'string',
'index' => 'not_analyzed'
'type' => 'keyword',
]
];
}
Expand Down
7 changes: 3 additions & 4 deletions src/Service.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,9 @@ public function generateMapping(ClassDefinition $objectClass) {
$mappingProperties = [
"o_id" => ["type" => "long"],
"o_checksum" => ["type" => "long"],
"type" => ["type" => "string", "index" => "not_analyzed"],
"key" => ["type" => "string", "index" => "not_analyzed"],
"path" => ["type" => "string", "index" => "not_analyzed"]
"type" => ["type" => "keyword"],
"key" => ["type" => "keyword"],
"path" => ["type" => "keyword"]
];

foreach($fieldDefinitions as $fieldDefinition) {
Expand All @@ -171,7 +171,6 @@ public function generateMapping(ClassDefinition $objectClass) {
]
];


return $mappingParams;

}
Expand Down

0 comments on commit 39fa64d

Please sign in to comment.