Disabling expensive queries in Elasticsearch can cause search issues within Liferay

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

¿Fue útil este artículo?
Usuarios a los que les pareció útil: 0 de 0