How are number fields and their BKD-trees represented internally?

where exactly does elasticsearch store numeric fields/ bkd trees? how are they indexed?
how is the relationship between text fields and number fields in a mapping defined internally?

This blog may help you understand:

This also may help: