Indices APIs
Index management:
Delete Index
Get Index
Indices Exists
Open / Close Index API
Shrink Index
Split Index
Rollover Index
### Mapping management:
Get Mapping
Get Field Mapping
Types Exists
Alias management:
Index settings:
Get Settings
Analyze
Index Templates
Monitoring:
Indices Segments
Indices Recovery
Indices Shard Stores
Status management:
Refresh
Flush
Force Merge
Create Index
index creation without any mapings
NOTE:
Index name limitations
There are several limitations to what you can name your index. The complete list of limitations are:
Cannot include , /, *, ?, “, <, >, |, ` ` (space character), ,, #
Indices prior to 7.0 could contain a colon (:), but that’s been deprecated and won’t be supported in 7.0+
Cannot start with -, _, +
Cannot be . or ..
Cannot be longer than 255 bytes (note it is bytes, so multi-byte characters will count towards the 255 limit faster)
Index Settings
To update index use this, in this payload we are detting mouner of shards and no of replicas
{
“settings” : {
“index” : {
“number_of_shards” : 3,
“number_of_replicas” : 2
}
}
}
‘
OR
{
“settings” : {
“number_of_shards” : 3,
“number_of_replicas” : 2
}
}
‘
Mappings
setting mappings to an index
{
“settings” : {
“number_of_shards” : 1
},
“mappings” : {
“_doc” : {
“properties” : {
“field1” : { “type” : “text” }
}
}
}
}
‘
setting Aliases
curl -XPUT localhost:9200/index1/_alias/index2
{
“aliases” : {
“alias_1” : {},
“alias_2” : {
“filter” : {
“term” : {“user” : “kimchy” }
},
“routing” : “kimchy”
}
}
}
‘