private Object convertFieldValueUsingType(SchemaField sf,final Object rawValue){
  if (rawValue instanceof CharSequence) {
    FieldType fieldType=userVersionField.getType();
    BytesRefBuilder term=new BytesRefBuilder();
    fieldType.readableToIndexed((CharSequence)rawValue,term);
    return fieldType.toObject(userVersionField,term.get());
  }
  return rawValue;
}

private Object convertFieldValueUsingType ( SchemaField sf , final Object rawValue ) { if ( rawValue instanceof CharSequence ) { FieldType fieldType = userVersionField . getType ( ) ; BytesRefBuilder term = new BytesRefBuilder ( ) ; fieldType . readableToIndexed ( ( CharSequence ) rawValue , term ) ; return fieldType . toObject ( userVersionField , term . get ( ) ) ; } return rawValue ; }
inspects a raw field value ( which may come from a doc in the index , or a doc in the updatelog that still has string values , or a string sent by the user as a param ) and if it is a string , asks the versionfield fieldtype to convert it to an object suitable for comparison .
