Issue
For complete word search, the highlighting of search keyword is fine but when we are searching for half word search, then it is either not highlighting the keyword (even if the keyword is present) or showing no results.
Example 1:
1. On search of "vertical" keyword, Liferay search is highlighting the keyword as expected.
2. On search of "vert" keyword, it is highlighting the keyword only in the title and not in the description.
Example 2:
3. On search of "standard" keyword, Liferay search is highlighting the keyword as expected.
4. On search of "stan" keyword, it is not showing any result.
Environment
- DXP 7.4
Resolution
-
Whether a keyword will return a highlighted match or not is up to Elasticsearch and its analyzers.
Search doesn't return results based on partial word matches but based on the stemmed version of the word. You can check this ES Documentation. In this case "stan" will not match "standard".
Additionally, we have designed title fields to more easily match keywords (using the Keyword type field). This would be why "vert" matches the title but not the description.
So, all this behavior is intended.