Elastic Search Mapping por Type

Si se necesita calcular la cantidad de fields por Type en Elastic Search, se puede extraer el mapping completo:

host:port/{index}/_mapping >> mapping.elasticsearch

Y luego usar jq para contar los fields por type

cat mapping.elasticsearch | jq '.[].mappings.<type>.properties' | grep type | wc -l

Read more