code: public final void write(EntityMetadata metadata, Object entity)
      {
          if (indexer != null)
          {
              MetamodelImpl metamodel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel(
                      metadata.getPersistenceUnit());
              ((com.impetus.kundera.index.lucene.Indexer) indexer).index(metadata, metamodel, entity);
          }
      }
docs: Indexes an object.
  
  @param metadata
  the metadata
  @param entity
  the entity