Skip to content

Commit 6090541

Browse files
committed
[FEATURE] indexing dimensions 'not_analyzed'
1 parent b2561c5 commit 6090541

2 files changed

Lines changed: 11 additions & 7 deletions

File tree

Classes/Flowpack/ElasticSearch/ContentRepositoryAdaptor/Indexer/NodeIndexer.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -176,13 +176,6 @@ public function indexNode(Node $node, $targetWorkspaceName = NULL) {
176176
$documentData['__dimensionCombinations'] = $dimensionCombinations;
177177
}
178178

179-
//@todo remove the hardcoded language part. There will be a merge of the Neos and TYPO3CR Settings
180-
if (is_array($dimensionCombinations)) {
181-
$documentData['__dimensions'] = array(
182-
"language" => $dimensionCombinations["language"][0]
183-
);
184-
}
185-
186179
if ($this->isFulltextEnabled($node)) {
187180
if ($this->isFulltextRoot($node)) {
188181
// for fulltext root documents, we need to preserve the "__fulltext" field. That's why we use the

Classes/Flowpack/ElasticSearch/ContentRepositoryAdaptor/Mapping/NodeTypeMappingBuilder.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,17 @@ public function buildMappingInformation(Index $index) {
9292
$type = $index->findType(self::convertNodeTypeNameToMappingName($nodeTypeName));
9393
$mapping = new Mapping($type);
9494

95+
// http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-root-object-type.html#_dynamic_templates
96+
// 'not_analyzed' is necessary
97+
$mapping->addDynamicTemplate('dimensions', array(
98+
'path_match' => '__dimensionCombinations.*',
99+
'match_mapping_type' => 'string',
100+
'mapping' => array(
101+
'type' => 'string',
102+
'index' => 'not_analyzed'
103+
)
104+
));
105+
95106
foreach ($nodeType->getProperties() as $propertyName => $propertyConfiguration) {
96107
if (isset($propertyConfiguration['search']) && isset($propertyConfiguration['search']['elasticSearchMapping'])) {
97108

0 commit comments

Comments
 (0)