code: void addDocument(Document doc) throws IOException
     {
        update(Collections.<String> emptyList(), Arrays.asList(new Document[]{doc}));
     }
docs: Adds a document to the index.
  
  @param doc
  the document to add.
  @throws IOException
  if an error occurs while adding the document to the index.