-
Notifications
You must be signed in to change notification settings - Fork 638
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Normalizing keywords for search index uses wrong language #3046
Comments
I’m not able to reproduce this. I created a Craft install with two sites (EN and DE) with EN being the primary. Then created a section enabled for both sites, and created a new entry with DE selected, title = “Zauberflöte”. As expected the entry will show up in search results for “Zauberflöte” regardless of which site is selected. Here is the Let me know if you can think of any other variables that could be affecting this on your site. If you’re not sure, please send your |
Thanks, but that's not the use case i tried to describe, sorry that my description was misleading. It's about the language the author selected for his personal use in the backend. So, if a user has this preferences: and saves the item, the table shows: If you change the preferences to this: and resave the entry, the table content is: and that is what works with this search in the german site: In helpers/Search.php line 88 there is // This will replace accented chars with non-accented chars
$map = StringHelper::asciiCharMap(true, Craft::$app->language); where, if i don't get it wrong, I could find a temporary workaround with some configuration settings 'customAsciiCharMappingss' => [
'a' => ['ä', 'Ä'],
'o' => ['ö', 'Ö'],
'u' => ['ü', 'Ü'],
's' => ['ß']
], but there might be some unwanted side effects (?), and it's deprecated anyway. Thanks again for your efforts, the multilingual feature was one of the main reasons our clients switched from another wellknown CMS to Craft. |
Sorry, I missed the |
Works now. Thanks for the quick fix. |
Description
The keywords for the search index are obviousliy built depending on the current users cp language. That should use the language of the site the entry is in.
Using Craft::$app->language in craft\helpers\Search
Steps to reproduce
Additional info
The text was updated successfully, but these errors were encountered: