diff --git a/core-bundle/src/EventListener/AddToSearchIndexListener.php b/core-bundle/src/EventListener/AddToSearchIndexListener.php
index <HASH>..<HASH> 100644
--- a/core-bundle/src/EventListener/AddToSearchIndexListener.php
+++ b/core-bundle/src/EventListener/AddToSearchIndexListener.php
@@ -56,7 +56,8 @@ class AddToSearchIndexListener
             return;
         }
 
-        if (preg_match('/'.preg_quote($this->fragmentPath, '/').'/', $event->getRequest()->getPathInfo())) {
+        // Do not index fragments
+        if (preg_match('~(?:^|/)'.preg_quote($this->fragmentPath, '~').'/~', $event->getRequest()->getPathInfo())) {
             return;
         }
[Core] Make the fragment regex more specific.