I am experiencing a bug with the search excerpts being displayed by search API, the bug only occurs with international characters (å,ö,ä) in the case of these characters an excerpt only shows up if the case matches exactly, whereas for standard characters the excerpt is shown even if the case does not match.

Comments

ghaya created an issue. See original summary.

drunken monkey’s picture

Component: General code » Plugins
Status: Active » Needs review
Issue tags: -excerpt
StatusFileSize
new3.2 KB
new3.87 KB

Thanks for reporting this issue!
I could have sworn there already was an issue for this, but it seems I was mistaken, since I can't find it anymore. (There was, however, one for Drupal 7, which I had overlooked and found this way, so even better: #2889989: Multi-byte partial-match highlighting is not case-insensitive.)

The attached patch should fix this, please test!

PS: It seems you (like many others – it's really easy to misinterpret) are confused by the "Issue tags" field. As the guidelines state, they aren't meant for free text tags related to the issue, but only for specific categorization purposes, usually by module maintainers.
So, if you aren't sure your current usage is correct, please just leave the field empty.

ghaya’s picture

Thank you! The patch in comment #2 did solve the problem.

  • drunken monkey committed 31a4e82 on 8.x-1.x
    Issue #2932347 by drunken monkey, ghaya: Fixed case insensitive matching...
drunken monkey’s picture

Status: Needs review » Fixed

Good to hear, thanks a lot for testing and reporting back!
Committed.

drunken monkey’s picture

Status: Fixed » Needs review
StatusFileSize
new4.35 KB

Oops, seems this isn't working on PHP 5.

Status: Needs review » Needs work

The last submitted patch, 7: 2932347-8--revert.patch, failed testing. View results

drunken monkey’s picture

Status: Needs work » Needs review
StatusFileSize
new4.4 KB

Oops again.

drunken monkey’s picture

Hm, maybe the Drupal test bot comes without multi-byte support in its PHP 5 environment?
In any case, it makes sense that we only test this if we expect it to be working – if MB support isn't available in PHP, that's not the fault of our module (I'd say).

drunken monkey’s picture

Ah, I think I've got it. PHP 5.6 apparently changed the default encoding type to UTF-8, for earlier versions you need to specify it explicitly when calling mb_stripos() (and similar functions).

  • drunken monkey committed 848bff3 on 8.x-1.x
    Issue #2932347 by drunken monkey, ghaya: Fixed case insensitive matching...
drunken monkey’s picture

Status: Needs review » Fixed

Committed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.