List<Fieldable> docFields = document.getFields();
serializer.fields( docFields );
for ( Fieldable fieldable : docFields ) {
if ( fieldable instanceof NumericField ) {
NumericField safeField = (NumericField) fieldable;
LuceneNumericFieldContext context = new LuceneNumericFieldContext( (NumericField) fieldable );
switch ( safeField.getDataType() ) {
case INT:
serializer.addIntNumericField(
safeField.getNumericValue().intValue(),
context