Help Center/ Cloud Search Service/ FAQs/ Using CSS Cluster Search Engines/ How Do I Clear Elasticsearch Cache in CSS?
Updated on 2026-11-26 GMT+08:00

How Do I Clear Elasticsearch Cache in CSS?

  • Clear the fielddata

    During aggregation and sorting, data is converted to the fielddata structure, which consumes extensive memory.

    1. Run the following command on Kibana to query the fielddata cache status:
      GET /_cat/nodes?v&h=name,fielddataMemory
    2. If the memory usage of fielddata is too high, you can run the following command to clear the fielddata cache of a specified index or all indexes:
      POST /test/_cache/clear?fielddata=true

      In the preceding command, test indicates the name of the index whose fielddata occupies a large amount of memory.

      POST /_cache/clear?fielddata=true
  • Clear segments

    The FST structure of each segment is loaded to the memory and will not be cleared. If the number of index segments gets too large, the memory usage will be high. You are advised to periodically clear the segments.

    1. Run the following command on Kibana to check the number of segments and their memory usage on each node:
      GET /_cat/nodes?v&h=segments.count,segments.memory&s=segments.memory:desc
    2. If segments consume too much memory, you can free up memory by deleting or closing unnecessary indexes, or periodically merging indexes that are no longer being updated.
  • Clear the cache

    Run the following command on Kibana to clear the cache:

    POST /_cache/clear