Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem
Search results would not return results if the original string was followed by punctuation.
Solution
Examining the search_index table reveals that puncuation was not being parsed out of the word list.
In the code to search.module
line:257 is:
$keys = preg_replace("'(!|%|,|:|;|\(|\)|\&|\"|\'|\.|-|\/|\?|\\\)'", '', $keys);
and I think it should be:
$wordlist = preg_replace("'(!|%|,|:|;|\(|\)|\&|\"|\'|\.|-|\/|\?|\\\)'", '', $wordlist);
This has it least fixed the indexing problem for me.
mitomac
Comments
Comment #1
Steven CreditAttribution: Steven commentedCommitted to 4.5.
Comment #2
(not verified) CreditAttribution: commented