[source, ruby]
----
response = client.indices.create(
  index: 'my-index-000001',
  body: {
    mappings: {
      dynamic: 'runtime',
      runtime: {
        day_of_week: {
          type: 'keyword',
          script: {
            source: "emit(doc['@timestamp'].value.dayOfWeekEnum.getDisplayName(TextStyle.FULL, Locale.ROOT))"
          }
        }
      },
      properties: {
        "@timestamp": {
          type: 'date'
        }
      }
    }
  }
)
puts response
----
