Legacy Knowledge Base
Published Sep. 10, 2025

Empty searches return no results using a Text Match Over Multiple Fields blueprint element

Written By

Daniel Mijarra

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

When a Blueprint is configured with the Text Match Over Multiple Fields element, performing an empty search yields no results.

Environment

  • Liferay DXP 7.4 U5+
  • Liferay DXP Quarterly Releases

Resolution

  • Text Match Over Multiple Fields element does not support empty searches, as it requires at least one keyword.
  • To achieve the desired behavior, you should create a custom copy of this element and add a condition to its JSON definition:
  1. Navigate to Global menu > Applications > Blueprints.
  2. Click on the Elements tab.
  3. Find the Text Match Over Multiple Fields element and make a copy (Actions button > Copy).
  4. Edit the copied element and give it a descriptive name (e.g., Custom Text Match Over Multiple Fields).
  5. In the elementDefinition section, edit the JSON.
  6. Locate queryEntries and add the following condition block:

    "condition": {
        "not": {
            "equals": {
                "parameterName": "keywords",
                "value": ""
            }
        }
    }

    The final queryEntries block should look similar to this:

    "queryEntries": [
        {
            "clauses": [
                {
                    "context": "query",
                    "occur": "must",
                    "query": {
                        "multi_match": {
                            "fuzziness": "${configuration.fuzziness}",
                            "query": "${keywords}",
                            "minimum_should_match": "${configuration.minimum_should_match}",
                            "boost": "${configuration.boost}",
                            "fields": "${configuration.fields}",
                            "type": "${configuration.type}",
                            "operator": "${configuration.operator}",
                            "slop": "${configuration.slop}"
                        }
                    }
                }
            ],
            "condition": {
                "not": {
                    "equals": {
                        "parameterName": "keywords",
                        "value": ""
                    }
                }
            }
        }
    ]
  7. Save.
  8. Edit your Blueprint and add the Custom Text Match Over Multiple Fields element. Configure it with the same settings as the original.
  9. Remove/disable the original Text Match Over Multiple Fields element.
  10. Save the Blueprint.
Did this article resolve your issue ?

Legacy Knowledge Base