refactoring mapper to create Elasticsearch mapping if required