conversionContext.popProperty();
}
}
// process the indexed fields
XMember previousMember = null;
Object currentFieldValue = null;
for ( int i = 0; i < propertiesMetadata.fieldNames.size(); i++ ) {
XMember member = propertiesMetadata.fieldGetters.get( i );
if ( previousMember != member ) {
currentFieldValue = unproxy( ReflectionHelper.getMemberValue( unproxiedInstance, member ),
objectInitializer );
previousMember = member;
if ( member.isCollection() ) {
if ( currentFieldValue instanceof Collection ) {
objectInitializer.initializeCollection( (Collection) currentFieldValue );
}
else if ( currentFieldValue instanceof Map ) {
objectInitializer.initializeMap( (Map) currentFieldValue );
}
}
}
final FieldBridge fieldBridge = propertiesMetadata.fieldBridges.get( i );
final String fieldName = propertiesMetadata.fieldNames.get( i );
final FieldBridge oneWayConversionContext = conversionContext.oneWayConversionContext( fieldBridge );
conversionContext.pushProperty( propertiesMetadata.fieldGetterNames.get( i ) );
try {
oneWayConversionContext.set(
fieldName, currentFieldValue, doc,
propertiesMetadata.getFieldLuceneOptions( i, currentFieldValue )
);
}
finally {
conversionContext.popProperty();
}
}
// allow analyzer override for the fields added by the class and field bridges
allowAnalyzerDiscriminatorOverride(
doc, propertiesMetadata, fieldToAnalyzerMap, processedFieldNames, unproxiedInstance
);
// recursively process embedded objects
for ( int i = 0; i < propertiesMetadata.embeddedGetters.size(); i++ ) {
XMember member = propertiesMetadata.embeddedGetters.get( i );
conversionContext.pushProperty( propertiesMetadata.embeddedFieldNames.get( i ) );
try {
Object value = ReflectionHelper.getMemberValue( unproxiedInstance, member );
//TODO handle boost at embedded level: already stored in propertiesMedatada.boost