code: private long createIndex(NodeDataIndexingIterator iterator, NodeData rootNode) throws IOException,
        RepositoryException
     {
        MultithreadedIndexing indexing = new MultithreadedIndexing(iterator, rootNode);
        return indexing.launch(false);
     }
docs: Create index.
  
  @param iterator
  the NodeDataIndexing iterator
  @param rootNode
  the root node of the index
  @return the total amount of indexed nodes
  @throws IOException
  if an error occurs while writing to the index.
  @throws RepositoryException
  if any other error occurs