getTerms

fun getTerms(r: IndexReader, field: String?): Terms?

This method may return null if the field does not exist or if it has no terms.