}
if ( idAnnotation instanceof DocumentId ) {
parseContext.setExplicitDocumentId( true );
}
FieldBridge idBridge = BridgeFactory.guessType( null, numericFieldAnn, member, reflectionManager );
if ( !( idBridge instanceof TwoWayFieldBridge ) ) {
throw new SearchException(
"Bridge for document id does not implement TwoWayFieldBridge: " + member.getName()
);
}
Field.TermVector termVector = AnnotationProcessingHelper.getTermVector( TermVector.NO );
DocumentFieldMetadata fieldMetadata =
new DocumentFieldMetadata.Builder(
prefix + attributeName,
Store.YES,
Field.Index.NOT_ANALYZED_NO_NORMS,
termVector
)
.id()
.boost( AnnotationProcessingHelper.getBoost( member, null ) )
.fieldBridge( idBridge )
.build();
PropertyMetadata idPropertyMetadata = new PropertyMetadata.Builder( member )
.addDocumentField( fieldMetadata )
.build();
typeMetadataBuilder.idProperty( idPropertyMetadata );
}
else {
//component should index their document id
String fieldName = prefix + attributeName;
Field.Index index = AnnotationProcessingHelper.getIndex( Index.YES, Analyze.NO, Norms.YES );
Field.TermVector termVector = AnnotationProcessingHelper.getTermVector( TermVector.NO );
FieldBridge fieldBridge = BridgeFactory.guessType( null, null, member, reflectionManager );
DocumentFieldMetadata fieldMetadata =
new DocumentFieldMetadata.Builder( fieldName, Store.YES, index, termVector )
.boost( AnnotationProcessingHelper.getBoost( member, null ) )
.fieldBridge( fieldBridge )