11<?php
2- namespace Flowpack \ElasticSearch \ContentRepositoryAdaptor \Mapping ;
2+ namespace Flowpack \ElasticSearch \ContentRepositoryAdaptor \Driver \ Version1 \ Mapping ;
33
44/*
55 * This file is part of the Flowpack.ElasticSearch.ContentRepositoryAdaptor package.
1111 * source code.
1212 */
1313
14+ use Flowpack \ElasticSearch \ContentRepositoryAdaptor \Driver \AbstractNodeTypeMappingBuilder ;
1415use Flowpack \ElasticSearch \Domain \Model \Index ;
1516use Flowpack \ElasticSearch \Domain \Model \Mapping ;
1617use Flowpack \ElasticSearch \Mapping \MappingCollection ;
1718use Neos \ContentRepository \Domain \Model \NodeType ;
1819use Neos \ContentRepository \Domain \Service \NodeTypeManager ;
20+ use Neos \Error \Messages \Result ;
1921use Neos \Flow \Annotations as Flow ;
2022use Neos \Flow \Configuration \ConfigurationManager ;
2123
2224/**
25+ * NodeTypeMappingBuilder for Elasticsearch version 1.x
2326 * Builds the mapping information for ContentRepository Node Types in Elasticsearch
24- *
2527 * @Flow\Scope("singleton")
2628 */
27- class NodeTypeMappingBuilder
29+ class NodeTypeMappingBuilder extends AbstractNodeTypeMappingBuilder
2830{
2931 /**
3032 * The default configuration for a given property type in NodeTypes.yaml, if no explicit elasticSearch section defined there.
@@ -40,7 +42,7 @@ class NodeTypeMappingBuilder
4042 protected $ nodeTypeManager ;
4143
4244 /**
43- * @var \Neos\Error\Messages\ Result
45+ * @var Result
4446 */
4547 protected $ lastMappingErrors ;
4648
@@ -77,12 +79,12 @@ public static function convertNodeTypeNameToMappingName($nodeTypeName)
7779 /**
7880 * Builds a Mapping Collection from the configured node types
7981 *
80- * @param \Flowpack\ElasticSearch\Domain\Model\ Index $index
81- * @return \Flowpack\ElasticSearch\Mapping\ MappingCollection<\Flowpack\ElasticSearch\Domain\Model\Mapping>
82+ * @param Index $index
83+ * @return MappingCollection<\Flowpack\ElasticSearch\Domain\Model\Mapping>
8284 */
8385 public function buildMappingInformation (Index $ index )
8486 {
85- $ this ->lastMappingErrors = new \ Neos \ Error \ Messages \ Result ();
87+ $ this ->lastMappingErrors = new Result ();
8688
8789 $ mappings = new MappingCollection (MappingCollection::TYPE_ENTITY );
8890
@@ -99,7 +101,7 @@ public function buildMappingInformation(Index $index)
99101 $ mapping ->setFullMapping ($ fullConfiguration ['search ' ]['elasticSearchMapping ' ]);
100102 }
101103
102- // http ://www.elasticsearch.org /guide/en/elasticsearch/reference/current/mapping-root-object-type .html#_dynamic_templates
104+ // https ://www.elastic.co /guide/en/elasticsearch/reference/2.4/dynamic-templates .html
103105 // 'not_analyzed' is necessary
104106 $ mapping ->addDynamicTemplate ('dimensions ' , [
105107 'path_match ' => '__dimensionCombinations.* ' ,
@@ -135,7 +137,7 @@ public function buildMappingInformation(Index $index)
135137 }
136138
137139 /**
138- * @return \Neos\Error\Messages\ Result
140+ * @return Result
139141 */
140142 public function getLastMappingErrors ()
141143 {
0 commit comments