Skip to content

Commit 487dccd

Browse files
committed
TASK: Check type of __fulltextParts to ensure it is always a hash map
1 parent 9efa79f commit 487dccd

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

Classes/Driver/Version1/IndexerDriver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public function fulltext(NodeInterface $node, array $fulltextIndexOfNode, $targe
114114
[
115115
// first, update the __fulltextParts, then re-generate the __fulltext from all __fulltextParts
116116
'script' => '
117-
if (!ctx._source.containsKey("__fulltextParts")) {
117+
if (!(ctx._source.containsKey("__fulltextParts") && ctx._source.__fulltextParts instanceof HashMap)) {
118118
ctx._source.__fulltextParts = new LinkedHashMap();
119119
}
120120

Classes/Driver/Version2/IndexerDriver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public function fulltext(NodeInterface $node, array $fulltextIndexOfNode, $targe
124124
'inline' => '
125125
ctx._source.__fulltext = new HashMap();
126126
127-
if (!ctx._source.containsKey("__fulltextParts")) {
127+
if (!(ctx._source.containsKey("__fulltextParts") && ctx._source.__fulltextParts instanceof HashMap)) {
128128
ctx._source.__fulltextParts = new HashMap();
129129
}
130130

0 commit comments

Comments
 (0)