private function writeIndexes()
    {
        //Begin database batch
        $this->beginBatch();

        //Index all node entities
        foreach ($this->nodeEntities as $entity)
        {
            $this->index($entity);
        }

        //Index all relation entities
        foreach ($this->relationEntities as $entity)
        {
            $this->index($entity);
        }

        //Write all repository indexes
        foreach ($this->repositories as $repository)
        {
            $repository->writeIndex();
        }

        //Commit batch to the database
        $this->commitBatch();
    }