// now add the entity id to the document
LuceneOptions luceneOptions = new LuceneOptionsImpl(
Store.YES,
Field.Index.NOT_ANALYZED_NO_NORMS, Field.TermVector.NO, idBoost
);
final ContextualExceptionBridge contextualBridge = new ContextualExceptionBridge()
.setFieldBridge(idBridge)
.setClass(entityType)
.setFieldName(idKeywordName);
if ( idGetter != null) {
contextualBridge.pushMethod( idGetter.getName() );
}
contextualBridge.set( idKeywordName, id, doc, luceneOptions );
if ( idGetter != null) {
contextualBridge.popMethod();
}
// finally add all other document fields
Set<String> processedFieldNames = new HashSet<String>();
buildDocumentFields( instance, doc, metadata, fieldToAnalyzerMap, processedFieldNames, contextualBridge );