You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Change output of _cat/fielddata to be row-centric #10249
which isn't really the spirit of the cat api. In order to find out how many fields are in the cache on michaelangelo, eg, you'd have to count the columns. In order to sort the fields in descending order by bytes, you'd have to do some significant processing (read: something more than counting some lines) outside the api, rather than just a ?bytes=b | sort -rnk999.
I propose something like:
id host ip node field size
lFPaYAUQTUGKOIKiRYZOeg hotel.local 10.0.1.200 raphael total 0b
djZlGw6qQcGBNCqW5iFoIA hotel.local 10.0.1.200 michaelangelo total 9.7kb
djZlGw6qQcGBNCqW5iFoIA hotel.local 10.0.1.200 michaelangelo title 8.2kb
djZlGw6qQcGBNCqW5iFoIA hotel.local 10.0.1.200 michaelangelo disambiguation 1.4kb
What if you have a field called total or have total in the name? Is it a good idea to mix the aggregate size with individual field sizes in the same table?
Maybe there could be a flag that would allow you to switch between totals or individual fields:
_cat/fielddata
id host ip node field size
djZlGw6qQcGBNCqW5iFoIA hotel.local 10.0.1.200 michaelangelo title 8.2kb
djZlGw6qQcGBNCqW5iFoIA hotel.local 10.0.1.200 michaelangelo disambiguation 1.4kb
But if you want totals:
_cat/fielddata?sum
id host ip node size
lFPaYAUQTUGKOIKiRYZOeg hotel.local 10.0.1.200 raphael 0b
djZlGw6qQcGBNCqW5iFoIA hotel.local 10.0.1.200 michaelangelo 9.7kb
I created a pull request that implements this behavior, see just above. Instead of the idea I described previously, it seemed cleaner to use _cat/fielddata for totals, and _cat/fielddata/{fields] for field level details.
E.g.:
curl '192.168.56.10:9200/_cat/fielddata'
id host ip node total
c223lARiSGeezlbrcugAYQ myhost1 10.20.100.200 Jessica Jones 385.6kb
waPCbitNQaCL6xC8VxjAwg myhost2 10.20.100.201 Adversary 435.2kb
yaDkp-G3R0q1AJ-HUEvkSQ myhost3 10.20.100.202 Microchip 284.6kb
Whereas if you want field-level data, you can do either curl '192.168.56.10:9200/_cat/fielddata?fields=body,text' or curl '192.168.56.10:9200/_cat/fielddata/*' to get:
id host ip node total field size
c223lARiSGeezlbrcugAYQ myhost1 10.20.100.200 Jessica Jones 385.6kb body 159.8kb
c223lARiSGeezlbrcugAYQ myhost1 10.20.100.200 Jessica Jones 385.6kb text 225.7kb
waPCbitNQaCL6xC8VxjAwg myhost2 10.20.100.201 Adversary 435.2kb body 159.8kb
waPCbitNQaCL6xC8VxjAwg myhost2 10.20.100.201 Adversary 435.2kb text 275.3kb
yaDkp-G3R0q1AJ-HUEvkSQ myhost3 10.20.100.202 Microchip 284.6kb body 109.2kb
yaDkp-G3R0q1AJ-HUEvkSQ myhost3 10.20.100.202 Microchip 284.6kb text 175.3kb
Activity
nirmalc commentedon Apr 8, 2015
Also filtering by fields by url param might be good addition
szroland commentedon Jun 17, 2015
What if you have a field called
totalor have total in the name? Is it a good idea to mix the aggregate size with individual field sizes in the same table?Maybe there could be a flag that would allow you to switch between totals or individual fields:
But if you want totals:
szroland commentedon Jun 21, 2015
I created a pull request that implements this behavior, see just above. Instead of the idea I described previously, it seemed cleaner to use
_cat/fielddatafor totals, and_cat/fielddata/{fields]for field level details.E.g.:
curl '192.168.56.10:9200/_cat/fielddata'Whereas if you want field-level data, you can do either
curl '192.168.56.10:9200/_cat/fielddata?fields=body,text'orcurl '192.168.56.10:9200/_cat/fielddata/*'to get:Let me know what you think.