Issue
-
Steps to reproduce:
1. Create a sample web content with the rupee or any other currency symbol in the content.
2. Try to search with just the currency symbol i.e. rupee or any other currency symbol.Expected Behaviour: Show the contents with the currency.
Actual Behaviour: Showing no results found.
Environment
- Liferay DXP U60
Resolution
-
This is an expected behavior. When using search analyzers certain words and characters are removed from indexing and/or searching. Most punctuation, including money symbols, are removed which you can see described under the Standard Analyzer in the Elasticsearch Documentation.
-
Liferay uses the Hindi analyzer for the Indian locale. If it's useful, tests can be done to see how the analyzer will tokenize text, for example, this is a Kibana query against a Liferay index:
GET /liferay-20097/_analyze { "analyzer": "hindi", "text": "$500 ₹2000 600₹ dog's bone." }This will return "500", "2000", "600", "dog", and "bone", and will remove symbols and punctuation as expected.
- The whitespace analyzer tokenizes the symbol and money together, for example, "₹100" as one term. So, you might need to create a custom analyzer for this requirement.
Additional Information
-
For setting the mappings to use a different analyzer, see Overriding type mappings in this article https://help.liferay.com/hc/en-us/articles/360028711152-Advanced-Configuration-of-the-Liferay-Elasticsearch-Connector