Purpose of 'Length' and 'Index' in DocField

Hi community, does anyone know the purpose of ‘length’ and ‘index’ in DocField as shown below?

@Raymond_Liew, length restrict the size of string fields like “Data”
index will create an index into the database table for that field.