Skip to content

Commit 19b00d5

Browse files
committed
BUGFIX: Fulltext parts are lost on document update
Use proper way of mapping node type name to `_type` in index. Closes #115
1 parent fdba49e commit 19b00d5

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • Classes/Flowpack/ElasticSearch/ContentRepositoryAdaptor/Indexer

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ public function indexNode(NodeInterface $node, $targetWorkspaceName = null)
164164
$mappingType = $this->getIndex()->findType(NodeTypeMappingBuilder::convertNodeTypeNameToMappingName($nodeType));
165165

166166
// Remove document with the same contextPathHash but different NodeType, required after NodeType change
167+
$this->logger->log(sprintf('NodeIndexer: Removing node %s from index (if node type changed from %s). ID: %s', $contextPath, $node->getNodeType()->getName(), $contextPathHash), LOG_DEBUG, NULL, 'ElasticSearch (CR)');
167168
$this->getIndex()->request('DELETE', '/_query', array(), json_encode([
168169
'query' => [
169170
'bool' => [
@@ -174,7 +175,7 @@ public function indexNode(NodeInterface $node, $targetWorkspaceName = null)
174175
],
175176
'must_not' => [
176177
'term' => [
177-
'_type' => str_replace('.', '/', $node->getNodeType()->getName())
178+
'_type' => NodeTypeMappingBuilder::convertNodeTypeNameToMappingName($node->getNodeType()->getName())
178179
]
179180
],
180181
]

0 commit comments

Comments
 (0)