verifyOrCreateDvOnlyField

fun verifyOrCreateDvOnlyField(fieldName: String, dvType: DocValuesType, fieldMustExist: Boolean)

This function is called from IndexWriter to verify if doc values of the field can be updated. If the field with this name already exists, we verify that it is a doc values-only field. If the field doesn't exist and the parameter fieldMustExist is false, we create a new field in the global field numbers.

Parameters

fieldName
  • name of the field

dvType
  • expected doc values type

fieldMustExist

– if the field must exist.

Throws

if the field must exist, but it doesn't, or if the field exists, but it is not doc values only field with the provided doc values type.