legacy-knowledge-base
公開されました 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

learn-legacy-article-disclaimer-text

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