Troubleshooting: Elasticsearch index build issues

Identify potential errors when building the HCL Commerce Search index using Elasticsearch.

Problem

Issues with building the HCL Commerce Search index, such as store search is not showing product/category or getting failed/unknown status of the index.

Solution

The following steps help to identify/detect the potential errors/problems causing the issue with building the HCL Commerce Search index.

Use the spiuser user credentials for authentication when making the following API calls.

  1. Retrieve the status information using the following API:
    https://TS_HOST:TS_PORT/wcs/resources/admin/index/dataImport/status?jobStatusId=jobId
    The API returns the status information in the form of one of the following status codes:
    • 1 = Failed
    • 2 (Old version) or 4 = Ingest could not determine the status the Index is in from Elasticsearch.
    • -1 = Index is still running.
    • 0 = Successful
  2. For deeper analysis, find runId using the following API:
    http://INGEST_HOST:INGEST_PORT/connectors/ConnectorName/runs
    This API returns a list of runId values that are associated with the build index of that particular connector/pipeline. Copy the latest runId.
  3. Check status information from Ingest using the following API:
    http://INGEST_HOST:INGEST_PORT/connectors/ConnectorName>/runs/runId/status
    Note:
    • Check message to understand on a high level what problems Ingest/Nifi has:
      • If the index build is stuck in a running state longer than usual, then the message lets you know which pipe index is stuck.
      • If the index build fails in the middle, then the message lets you know the issues in the pipe causing the index failure.
    • The API returns the status information in the form of one of the following status codes:
      • 1 = Failed
      • 2 (Old version) or 4 = Ingest could not determine the status the Index is in from Elasticsearch.
      • -1 = Index is still running.
      • 0 = Successful
  4. Using Ingest check detailed information from Elasticsearch logs:
    • Ingest Swagger:
      /connectors/{connectorId}/runs/{runId}
    • Full URL:
      http://INGEST_HOST:INGEST_PORT/connectors/ConnectorName/runs/runId?size=1000&type=summary%2Ctrace%2Clog&logSeverity=I%2CE%2CT&orderDate=asc
    Note:
    • Check every log for severity: E (can also filter using the above API). These log messages display errors relating to pipes.
    • Each error log has fields, attributes and message. These fields provide more details about the issue the pipe has encountered.
  5. Check Bulletin Board by clicking the menu on the top right in the NiFi console. The Bulletin Board displays recent pipe errors.