Skip to content

Commit cd739c7

Browse files
committed
Merge pull request #116 from kdambekalns/fix-document-fulltext-index
BUGFIX: Fulltext parts are lost on document update
2 parents fdba49e + 19b00d5 commit cd739c7

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)