Querying Elastic search with german umlauts showing encoding errors #4007

Open
opened 2026-02-20 16:12:30 -05:00 by deekerman · 2 comments
Owner

Originally created by @schapsl on GitHub (Sep 24, 2019).

Search terms with german umlauts are shown with broken encondings on the results page.

Issue

When results from elastic search are displayed and the search term contains german umlauts (or non-ascii utf8 characters) the search term is displayed in the input field again and contains an encoding error.

Displaying results for "Köln" will show "Köln" as query string in the input field.

Expected Behavior

The search term should be correctly displayed as

Actual Behavior

Possible Fix

In lib/Search/SearchEngine.php SearchEnging::searchAndDisplay(SearchQuery $query)
remove the call to $this->validateQuery($query);.
$this->validateQuery($query); will be called within $this->search($query); anyway and is not needed for $this->displayForm($query);

Steps to Reproduce

  1. Setup Elastic search
  2. Query for "Köln"

Results or no results, in the following page the input field with the search term will show "Köln"

Context

Elastic search is not usable in languages with non-ascii characters.

Your Environment

  • SuiteCRM Version used: 7.11.5
  • Browser name and version (e.g. Chrome Version 51.0.2704.63 (64-bit)): Version 77.0.3865.90 (Offizieller Build) (64-Bit)
  • Environment name and version (e.g. MySQL, PHP 7): PHP 7.2.1, MariaDB 10.1.30-MariaDB, for Win32 (AMD64)
  • Operating System and version (e.g Ubuntu 16.04): Windows 10.0 build 17763 (Windows 10) i586
Originally created by @schapsl on GitHub (Sep 24, 2019). <!--- Provide a general summary of the issue in the **Title** above --> Search terms with german umlauts are shown with broken encondings on the results page. #### Issue When results from elastic search are displayed and the search term contains german umlauts (or non-ascii utf8 characters) the search term is displayed in the input field again and contains an encoding error. Displaying results for "Köln" will show "Köln" as query string in the input field. <!--- Before you open an issue, please check if a similar issue already exists or has been closed before. ---> <!--- If you have discovered a security risk please report it by emailing security@suitecrm.com. This will be delivered to the product team who handle security issues. Please don't disclose security bugs publicly until they have been handled by the security team. ---> <!--- Provide a more detailed introduction to the issue itself, and why you consider it to be a bug --> #### Expected Behavior <!--- Tell us what should happen --> The search term should be correctly displayed as #### Actual Behavior <!--- Tell us what happens instead --> <!--- Also please check relevant logs (suitecrm.log, php error.log etc.) --> #### Possible Fix <!--- Not obligatory, but suggest a fix or reason for the bug --> In `lib/Search/SearchEngine.php SearchEnging::searchAndDisplay(SearchQuery $query)` remove the call to `$this->validateQuery($query);`. `$this->validateQuery($query);` will be called within `$this->search($query);` anyway and is not needed for `$this->displayForm($query);` #### Steps to Reproduce <!--- Provide a link to a live example, or an unambiguous set of steps to --> <!--- reproduce this bug include code to reproduce, if relevant --> 1. Setup Elastic search 2. Query for "Köln" Results or no results, in the following page the input field with the search term will show "Köln" #### Context <!--- How has this bug affected you? What were you trying to accomplish? --> <!--- If you feel this should be a low/medium/high priority then please state so --> Elastic search is not usable in languages with non-ascii characters. #### Your Environment <!--- Include as many relevant details about the environment you experienced the bug in --> * SuiteCRM Version used: 7.11.5 * Browser name and version (e.g. Chrome Version 51.0.2704.63 (64-bit)): Version 77.0.3865.90 (Offizieller Build) (64-Bit) * Environment name and version (e.g. MySQL, PHP 7): PHP 7.2.1, MariaDB 10.1.30-MariaDB, for Win32 (AMD64) * Operating System and version (e.g Ubuntu 16.04): Windows 10.0 build 17763 (Windows 10) i586
Author
Owner

@SuiteBot commented on GitHub (Jan 25, 2022):

This issue has been mentioned on SuiteCRM. There might be relevant details there:

https://community.suitecrm.com/t/alguien-con-elasticsearch-funcionando-correctamente-con-tildes-y-enes/83769/1

@SuiteBot commented on GitHub (Jan 25, 2022): This issue has been mentioned on **SuiteCRM**. There might be relevant details there: https://community.suitecrm.com/t/alguien-con-elasticsearch-funcionando-correctamente-con-tildes-y-enes/83769/1
Author
Owner

@SuiteBot commented on GitHub (Jan 25, 2022):

This issue has been mentioned on SuiteCRM. There might be relevant details there:

https://community.suitecrm.com/t/somebody-happy-with-suitecrm-7-12-2-and-elasticsearch/83751/3

@SuiteBot commented on GitHub (Jan 25, 2022): This issue has been mentioned on **SuiteCRM**. There might be relevant details there: https://community.suitecrm.com/t/somebody-happy-with-suitecrm-7-12-2-and-elasticsearch/83751/3
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/SuiteCRM-SuiteCRM#4007
No description provided.