Legacy Knowledge Base
Published Jun. 30, 2025

Disabling expensive queries in Elasticsearch can cause search issues within Liferay

Written By

Christopher Lui

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

By default, Elasticsearch sets search.allow_expensive_queries to true. However, if you set it to false, it can cause issues with not being able to search for any content or Liferay Search Blueprints not working.
You may see errors like:

java.lang.RuntimeException: org.elasticsearch.ElasticsearchStatusException: ElasticsearchStatusException[Elasticsearch exception [type=search_phase_execution_exception, reason=all shards failed]]; nested: ElasticsearchException[Elasticsearch exception [type=exception, reason=[joining] queries cannot be executed when 'search.allow_expensive_queries' is set to false.]];

 

Environment

  • Elasticsearch
  • Liferay 7.0-7.4

Resolution

Leave search.allow_expensive_queries as true. This way, Elasticsearch will be able to perform more complex queries, such as Date Math.

Additional Information

Did this article resolve your issue ?

Legacy Knowledge Base