Skip to content

Instantly share code, notes, and snippets.

View felixbarny's full-sized avatar

Felix Barnsteiner felixbarny

View GitHub Profile
@felixbarny
felixbarny / gist:1f6ef39321849d7dd3889c5998e02a21
Created August 25, 2021 13:04
Flattened and runtime field test
PUT test
{
"mappings": {
"dynamic": "runtime",
"properties": {
"service": {
"type": "object",
"properties": {
"name": {
"type": "keyword"
@felixbarny
felixbarny / disk_usage_by_field.sh
Created February 6, 2025 07:27
Handy scripts to analyze the disk_usage output from Elasticsearch
echo field, total, doc_values, inverted_index, points
curl -s $1 |
jq -r '.
| to_entries
| .[]
| select(.key != "_shards")
| .value.fields
| to_entries
| .[]
| "\(.key), \(.value.total_in_bytes), \(.value.doc_values_in_bytes), \(.value.inverted_index.total_in_bytes), \(.value.points_in_bytes)"'