DocumentBuilderIndexedEntity documentBuilder = getDocumentBuilder( searchFactoryImplementor, clazz );
return documentBuilder.getIdentifierName();
}
public static Object[] getDocumentFields(SearchFactoryImplementor searchFactoryImplementor, Class<?> clazz, Document document, String[] fields, ConversionContext conversionContext) {
DocumentBuilderIndexedEntity builderIndexedEntity = getDocumentBuilder( searchFactoryImplementor, clazz );
final int fieldNbr = fields.length;
Object[] result = new Object[fieldNbr];
Arrays.fill( result, NOT_SET );
conversionContext.setClass( clazz );
if ( builderIndexedEntity.getIdKeywordName() != null ) {
final String fieldName = builderIndexedEntity.getIdKeywordName();
int matchingPosition = getFieldPosition( fields, fieldName );
if ( matchingPosition != -1 ) {
conversionContext.pushProperty( fieldName );
try {
populateResult(
fieldName,
builderIndexedEntity.getIdBridge(),
Store.YES,
result,
document,
conversionContext,
matchingPosition
);
}
finally {
conversionContext.popProperty();
}
}
}
final TypeMetadata metadata = builderIndexedEntity.getMetadata();
processFieldsForProjection( metadata, fields, result, document, conversionContext );
return result;
}