set

fun set(fld: String, bytes: BytesRef)

Resets the field and text of a Term.

WARNING: the provided BytesRef is not copied, but used directly. Therefore the bytes should not be modified after construction, for example, you should clone a copy rather than pass reused bytes from a TermsEnum.