X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/213a86e3c0ffa36d4aed030eb72d5d65204d02ff..refs/pull/5725/head:/app/Search/SearchIndex.php diff --git a/app/Search/SearchIndex.php b/app/Search/SearchIndex.php index 36f71f6cc..844e3584b 100644 --- a/app/Search/SearchIndex.php +++ b/app/Search/SearchIndex.php @@ -160,7 +160,9 @@ class SearchIndex /** @var DOMNode $child */ foreach ($doc->getBodyChildren() as $child) { $nodeName = $child->nodeName; - $termCounts = $this->textToTermCountMap(trim($child->textContent)); + $text = trim($child->textContent); + $text = str_replace("\u{00A0}", ' ', $text); + $termCounts = $this->textToTermCountMap($text); foreach ($termCounts as $term => $count) { $scoreChange = $count * ($elementScoreAdjustmentMap[$nodeName] ?? 1); $scoresByTerm[$term] = ($scoresByTerm[$term] ?? 0) + $scoreChange;