Legacy Knowledge Base
Published Jun. 30, 2025

Highlighting search keyword in Liferay Search

Written By

Debora Vita

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

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.

 

Did this article resolve your issue ?

Legacy Knowledge Base