Skip to content

Instantly share code, notes, and snippets.

@RohitRox
Last active April 24, 2020 21:50
Show Gist options
  • Save RohitRox/0911f592185a299f60f255aa3e262dbf to your computer and use it in GitHub Desktop.
Save RohitRox/0911f592185a299f60f255aa3e262dbf to your computer and use it in GitHub Desktop.
ElasticSearchStuff

list indices

http://localhost:9200/_cat/indices?v

create index

PUT indexName
{
    "mappings" : {
        "_doc" : {
            "properties" : {
                "field1" : { "type" : "text" }
            }
        }
    }
}

list index mapping

indexName/_mapping?pretty

delete index

DELETE /indexName

curl -X DELETE "localhost:9200/indexName?pretty"

search

/indexName/_search?pretty

[FORBIDDEN/12/index read-only / allow delete (api)]

.kibana/_settings?pretty
# blocks.read_only_allow_delete => false
OR
_cluster/settings?pretty
OR
indexName/_settings?pretty
PUT /[index_name]/_settings
{
  "index.blocks.read_only_allow_delete": null
}

OR 

PUT /*/_settings
{
  "index.blocks.read_only_allow_delete": null
}

curl -X PUT "localhost:9200/*/_settings" -H 'Content-Type: application/json' -d'{"index.blocks.read_only_allow_delete": null}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment