properly indexing each collection under a ES type and avoiding stringifying null values