Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.x]: Indexed keywords of sentences/words with single quotes/apostrophes are not correct in some cases #12467

Closed
ReedBe opened this issue Dec 16, 2022 · 2 comments
Assignees

Comments

@ReedBe
Copy link

ReedBe commented Dec 16, 2022

What happened?

Description

I have noticed that the search indexation is not working correctly when the search query includes words with single quotes or apostrophes, such as "l'orange" or "l'espace" in French. These words should be indexed as "orange" and "espace", but they are being indexed as "lorange" and "lespace" instead.

Upon investigation, I believe the issue may be related to this line of code: https://github.com/craftcms/cms/blob/develop/src/helpers/Search.php#L87.

An easy fix would be to give the the possibility to define a custom $asciiPunctuation variable to allow for better handling of these types of characters in search queries. This would greatly improve the usability of the search feature for users who speak languages that make use of single quotes or apostrophes.

Steps to reproduce

  1. Create an entry with this sentence Bienvenue de l'espace

Expected behavior

Keywords in the database should be bienvenue dans espace

Actual behavior

Keywords in the database are bienvenue dans lespace

Craft CMS version

4.x

PHP version

No response

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

@brandonkelly
Copy link
Member

Thanks for reporting! This has been fixed for the next Craft 3 and 4 releases via 5524417.

@brandonkelly
Copy link
Member

Craft 3.7.63 and 4.3.6 are out with that fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants