If I search for brown, and have documents that contain brown and Brown. I only get brown highlighted and not all occurences.
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | highlight.module.patch | 957 bytes | guardian |
| #5 | highlight.patch | 963 bytes | stevenpatz |
If I search for brown, and have documents that contain brown and Brown. I only get brown highlighted and not all occurences.
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | highlight.module.patch | 957 bytes | guardian |
| #5 | highlight.patch | 963 bytes | stevenpatz |
Comments
Comment #1
stevenpatzComment #2
mindless commenteddon't see a patch. updated title.
Comment #3
stevenpatzTurns out the fix for this, that I wanted to use is a PHP5 only solution.
Comment #4
mindless commentedHavn't seen any activity here.. maybe it is worth posting the PHP5 solution, at least as a starting point.
Comment #5
stevenpatzCurrently the highlight module uses:
str_replaceAnd it should use:
str_ireplaceWhich according to this:
http://us2.php.net/manual/en/function.str-ireplace.php
Is for PHP 5 only.
Comment #6
stevenpatzComment #7
stevenpatzComment #8
nedjoGood idea, but because it's PHP 5 we'd need a PHP 4 workaround.
Comment #9
stevenpatzComment #10
pjb commentedHi,
In the comments for the str_ireplace() function someone submitted what looks to be a PHP4-compatible solution:
That might be a workaround, though the foreach() kind of worries me from a performance standpoint. Another comment mentions that this function is also part of the PHP_compat PEAR package, but I don't know how viable a solution that is for everyone.
Comment #11
guardian commentedi quickly hacked a patch that uses
preg_replaceinstead of string replace. I was not satistifed with the previous patches because using?highlight=foowould effectively match "Foo" or any other case variation but the highlighted text would be "foo", that is would use the case from the search query or the URL query.Comment #12
guardian commentedplease if you applied the patch i submitted, could you report whether or not it works for you ?
Comment #13
arthurf commentedI just applied the patch. If you are interested in becoming a maintainer of this module I'd be glad to hand it over- my other work does quite give me the attention for this.
Comment #14
guardian commenteddeal :)
Comment #15
arthurf commentedGuardian- I gave you CVS access. Once you've got everything under control, you can take full ownership. Thanks so much for taking this on!
Comment #16
memoday commentedHello everybody, I am sorry to reopen this. How can you make this work for the D7 version? I checked the highlight.module and it's totally different from the batches here. Any idea?
Comment #17
memoday commentednever mind, you can actually achieve the same results by adding the i to the regex under admin/config/search/highlight/settings
for example:
/.+[&?i]search_fulltext=([^&]+).*$Comment #18
shenzhuxi commented