Creating a serializer callable for every type in an index and passing it to elastica