<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_idx_types(rng_def, ranges):
 """ Returns the elasticsearch index types for the obj args: rng_def: the range defintion dictionay ranges: rdfproperty ranges """

    idx_types = rng_def.get('kds_esIndexType', []).copy()
    if not idx_types:
        nested = False
        for rng in ranges:
            if range_is_obj(rng, __MODULE__.rdfclass):
                nested = True
        if nested:
            idx_types.append('es_Nested')
    return idx_types