Opensearch – Yellow / Top Queries

With an update of opensearch there suddenly is a new index called top_queries-xxxx. This will turn yellow on a single-node cluster, as it want’s two replicase. Apperantely, it’s not in the interest of opensearch, to create stuff, that works with their own software. So we have to fix it ourtselfs. Once again.

Luckely this is easy to do:

curl -X PUT 'http://localhost:9200/_index_template/top-queries-fix?pretty' -H 'Content-Type: application/json' -d '{
  "index_patterns": [
    "top_queries-*"
  ],
  "template": {
    "settings": {
      "number_of_shards": 1,
      "number_of_replicas": 0
    }
  }
}'

This will create a template for all top-queries indexes, to be replica free. We can directly push this changes into the existing index with the following command, or just delete it.

curl -XPUT localhost:9200/top_queries-2025.02.18-91878/_settings -H 'Content-Type: application/json' -d '{
  "index" : {
    "number_of_replicas" : 0
  }
}'

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.