Legacy Knowledge Base
Published Jun. 30, 2025

Elasticsearch no such index found or index created without mappings

Written By

Daniel Martinez Cisneros

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

In certain instances, an Elasticsearch node index might be improperly created, and documents appear to be successfully injected, but attempts to search for assets in the portal result in no findings.

Despite modifying the debug level in the com.liferay.portal.search packages, no errors are displayed, and Elasticsearch's log records the query without any issues.

This issue could be caused by an incorrect mapping for the related index in Elasticsearch.

Environment

  • Liferay DXP 7.0
  • Liferay DXP 7.1
  • Liferay DXP 7.2
  • Liferay DXP 7.3
  • Liferay DXP 7.4
  • Quarterly Release 2023.Q4

Resolution

It could be provoked by a wrong index mapping, in order to resolve this issue, follow these steps: 

  1. Verify the index mappings:
    curl "http://${ip_elasticsearch}:9200/${prefix_index}-*/_mapping/LiferayDocumentType"
  2. Check Elasticsearch if property action.auto_create_index is false, in order to avoid index creation automatically. 
  3. Delete erroneus index:

    curl -X DELETE "${ip_elasticsearch}:9200/${index_name}?pretty"
  4. Force reindexing for the instance associated with the erroneous index with the following groovy script. (Note: replace 9999999 with the companyId of your instance)

    /* Company to full reindex */
    def companyId = 9999999;
    def userId = java.lang.Long.parseLong(userInfo.get("liferay.user.id"));
    com.liferay.portal.kernel.search.IndexWriterHelperUtil.reindex(userId, "reindex", [companyId] as long[], null);
  5. Recheck the index mapping again. Now, you should be able to search for assets in that company 

Additional Information

 

Did this article resolve your issue ?

Legacy Knowledge Base