{"id":18358999,"url":"https://github.com/ev2900/opensearch_read_only_index","last_synced_at":"2025-07-13T06:34:26.815Z","repository":{"id":85139196,"uuid":"592060943","full_name":"ev2900/OpenSearch_Read_Only_Index","owner":"ev2900","description":"  Example covering how to set an OpenSearch index to read only. A common prerequisite for performance tuning tasks","archived":false,"fork":false,"pushed_at":"2025-06-18T16:37:32.000Z","size":107,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-18T17:39:46.008Z","etag":null,"topics":["aws","opensearch","read-only"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ev2900.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-01-22T19:54:47.000Z","updated_at":"2025-06-18T16:37:36.000Z","dependencies_parsed_at":"2024-02-16T23:26:30.181Z","dependency_job_id":"92183add-4f36-4d7b-b326-c884ef2a6a17","html_url":"https://github.com/ev2900/OpenSearch_Read_Only_Index","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ev2900/OpenSearch_Read_Only_Index","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ev2900%2FOpenSearch_Read_Only_Index","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ev2900%2FOpenSearch_Read_Only_Index/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ev2900%2FOpenSearch_Read_Only_Index/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ev2900%2FOpenSearch_Read_Only_Index/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ev2900","download_url":"https://codeload.github.com/ev2900/OpenSearch_Read_Only_Index/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ev2900%2FOpenSearch_Read_Only_Index/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262465750,"owners_count":23315638,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","opensearch","read-only"],"created_at":"2024-11-05T22:20:18.156Z","updated_at":"2025-07-13T06:34:26.803Z","avatar_url":"https://github.com/ev2900.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenSearch Read Only Index\n\n\u003cimg width=\"85\" alt=\"map-user\" src=\"https://img.shields.io/badge/views-2343-green\"\u003e \u003cimg width=\"125\" alt=\"map-user\" src=\"https://img.shields.io/badge/unique visits-1682-green\"\u003e\n\nIf you prefer to watch a video instead of reading the instructions below, check out the link below\n\nYouTube video - https://youtu.be/45T49W9DHo4\n\n## Overview\nOpenSearch indices can be set to read only ie. all write requests will throw an exception and be blocked. There are multiple reasons why you would want to make an index read only. One reason is before running certain back end operations such as a force merge it is recommended to make an index read only.\n\nThe instructions below demonstrate how to make an index read only and the enable writes again.\n\n## Set an Index to Read Only\n\nRunning\n\n```\nPUT sample-data/_settings\n{\n  \"index\": {\n    \"blocks.read_only\": true\n  }\n}\n```\n\nWill set the index **sample-data** to read only. After running the API call above if you try to write a document to the index you will receive an error\n\n\u003cimg width=\"800\" alt=\"cat_indicies_1\" src=\"https://github.com/ev2900/OpenSearch_Read_Only_Index/blob/main/README/read_only_true.PNG\"\u003e\n\n## Disable Read Only (ie. enable writes)\n\nTo re-enable writes or disable read only you can run the following API call\n\n```\nPUT sample-data/_settings\n{\n  \"index\": {\n    \"blocks.read_only\": false\n  }\n}\n```\n\nOnce read only is false, you can again write data to the index\n\n\u003cimg width=\"800\" alt=\"cat_indicies_1\" src=\"https://github.com/ev2900/OpenSearch_Read_Only_Index/blob/main/README/read_only_false.PNG\"\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fev2900%2Fopensearch_read_only_index","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fev2900%2Fopensearch_read_only_index","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fev2900%2Fopensearch_read_only_index/lists"}