How ES Applying Mapping when inserting Document?

Hi,

Can Anybody tell how ES applying mapping when inserting document(I mean what logic they are using for mapping at the time of document insertion). If anybody find in ES code just reply with Java File Name.

Thanks,
Sumit Gupta