1111 * source code.
1212 */
1313
14+ use TYPO3 \Flow \Annotations as Flow ;
1415use Flowpack \ElasticSearch \ContentRepositoryAdaptor \Driver \Version2 ;
1516use Flowpack \ElasticSearch \Domain \Model \Index ;
1617use Flowpack \ElasticSearch \Domain \Model \Mapping ;
1718use Flowpack \ElasticSearch \Mapping \MappingCollection ;
18- use TYPO3 \Flow \Annotations as Flow ;
1919use TYPO3 \Flow \Error \Result ;
2020use TYPO3 \Flow \Error \Warning ;
2121use TYPO3 \Flow \Object \ObjectManagerInterface ;
2222use TYPO3 \TYPO3CR \Domain \Model \NodeType ;
2323
2424/**
25- * NodeTypeMappingBuilder for Elasticsearch version 2 .x
25+ * NodeTypeMappingBuilder for Elasticsearch version 5 .x
2626 *
2727 * @Flow\Scope("singleton")
2828 */
@@ -111,7 +111,7 @@ public function buildMappingInformation(Index $index)
111111 * | 2.x | 5.x |
112112 * |-------------------------------------------|----------------------------------|
113113 * | "type": "string", "index": "no" | "type": "text", "index": false |
114- * | "type": "string"[ , "index": "analyzed"] | "type": "text", "index": true |
114+ * | "type": "string", "index": "analyzed" | "type": "text", "index": true |
115115 * | "type": "string", "index": "not_analyzed" | "type": "keyword", "index": true |
116116 *
117117 * @param array &$mapping
@@ -132,9 +132,12 @@ protected function adjustStringTypeMapping(array &$mapping)
132132 } elseif (isset ($ item ['index ' ]) && $ item ['index ' ] === 'no ' ) {
133133 $ item ['type ' ] = 'text ' ;
134134 $ item ['index ' ] = false ;
135- } else {
135+ } elseif ( isset ( $ item [ ' index ' ]) && $ item [ ' index ' ] === ' analyzed ' ) {
136136 $ item ['type ' ] = 'text ' ;
137137 $ item ['index ' ] = true ;
138+ } else {
139+ $ item ['type ' ] = 'keyword ' ;
140+ $ item ['index ' ] = true ;
138141 }
139142 }
140143
0 commit comments