code: public void updateDocument(String id, Document document, String EmbeddedEntityFieldName)
      {
          if (log.isDebugEnabled())
          {
              log.debug("Updateing indexed document: {} for in file system using Lucene", document);
          }
  
          IndexWriter w = getIndexWriter();
          try
          {
              Term term = null;
              if (EmbeddedEntityFieldName == null)
              {
                  term = new Term(IndexingConstants.ENTITY_ID_FIELD, id);
              }
              else
              {
                  term = new Term(EmbeddedEntityFieldName, id);
              }
              w.updateDocument(term, document);
  
          }
          catch (LuceneIndexingException lie)
          {
              log.error("Error while updating LuceneIndexer, Caused by :.", lie);
              throw new LuceneIndexingException(lie);
          }
          catch (IOException ioe)
          {
              log.error("Error while reading Lucene indexes, Caused by :.", ioe);
  
          }
      }
docs: Indexes document in file system using lucene.
  
  @param metadata
  the metadata
  @param document
  the document