code: public void indexDocument(EntityMetadata metadata, Document document)
      {
          if (log.isDebugEnabled())
          {
              log.debug("Indexing document: {} for in file system using Lucene", document);
          }
  
          IndexWriter w = getIndexWriter();
          try
          {
              w.addDocument(document);
          }
          catch (Exception e)
          {
              log.error("Error while indexing document {} into Lucene, Caused by:{} ", document, e);
              throw new LuceneIndexingException("Error while indexing document " + document + " into Lucene.", e);
          }
      }
docs: Indexes document in file system using lucene.
  
  @param metadata
  the metadata
  @param document
  the document