Which version of the stack are you using? 7.10 was the last version that cached the fields definitions (PR)
I've tested the following with 7.15:
# Create an index with some docs
DELETE test_warning_fields
PUT test_warning_fields
{
"mappings": {
"properties": {
"field1": { "type": "text"},
"field2": { "type": "text"},
"field3": { "type": "text"},
"field4": { "type": "text"}
}
}
}
POST test_warning_fields/_bulk
{ "index" : { "_id" : "1" } }
{ "field1" : "value1", "field2" : "value1","field3" : "value1","field4" : "value1"}
{ "index" : { "_id" : "2" } }
{ "field1" : "value1", "field2" : "value1","field3" : "value1","field4" : "value1"}
{ "index" : { "_id" : "3" } }
{ "field1" : "value1", "field2" : "value1","field3" : "value1","field4" : "value1"}
{ "index" : { "_id" : "4" } }
{ "field1" : "value1", "field2" : "value1","field3" : "value1","field4" : "value1"}
{ "index" : { "_id" : "5" } }
{ "field1" : "value1", "field2" : "value1","field3" : "value1","field4" : "value1"}
{ "index" : { "_id" : "6" } }
{ "field1" : "value1", "field2" : "value1","field3" : "value1","field4" : "value1"}
# Create the index pattern
# Check in Discover, all OK
Then I regenerated the index with different fields to try to break Kibana:
# Regenerate the index with other fields
DELETE test_warning_fields
PUT test_warning_fields
{
"mappings": {
"properties": {
"field5": { "type": "text"},
"field6": { "type": "text"},
"field7": { "type": "text"},
"field8": { "type": "text"}
}
}
}
POST test_warning_fields/_bulk
{ "index" : { "_id" : "1" } }
{ "field5" : "value5", "field6" : "value1","field7" : "value1","field8" : "value1"}
{ "index" : { "_id" : "2" } }
{ "field5" : "value5", "field6" : "value1","field7" : "value1","field8" : "value1"}
{ "index" : { "_id" : "3" } }
{ "field5" : "value5", "field6" : "value1","field7" : "value1","field8" : "value1"}
{ "index" : { "_id" : "4" } }
{ "field5" : "value5", "field6" : "value1","field7" : "value1","field8" : "value1"}
{ "index" : { "_id" : "5" } }
{ "field5" : "value5", "field6" : "value1","field7" : "value1","field8" : "value1"}
{ "index" : { "_id" : "6" } }
{ "field5" : "value5", "field6" : "value1","field7" : "value1","field8" : "value1"}
But the index pattern and discover reflected the new schema
Hope it helps!