public function createIndex($moduleName, $pageId, $exclude = array(),
                                $_defaultPath = self::FOLDER_PATH)
    {
        $this->tmpLogs = '';

        $pageContent = '';
        $folderPath = $_defaultPath . $moduleName;
        $lucenePath = $folderPath. '/' .self::FOLDER_NAME;

        // check if the module exists
        if(file_exists($folderPath)) {
            // check if the path exists
            if(!file_exists($lucenePath)) {

                $this->createDir($lucenePath);

                $this->tmpLogs = $this->createIndexForPages($lucenePath, $pageId, $exclude);
            }
            else {
                $this->changePermission($lucenePath);

                $this->tmpLogs = $this->createIndexForPages($lucenePath, $pageId, $exclude);

            }
        }


        return $this->tmpLogs;
    }