public function addLuceneIndexAction()
    {
        $moduleName = $this->params()->fromRoute('moduleName', null);
        $pageId = $this->params()->fromRoute('pageid', null);
        $excludes = $this->params()->fromRoute('expageid', null);
        $status = '';

        /** @var \MelisEngine\Service\MelisSearchService $searchIndex */
        $searchIndex = $this->getServiceLocator()->get('MelisSearch');

        if ($moduleName && $pageId) {
            $tmpexPageIds = explode(';', $excludes);
            $exPageIds = [];
            foreach ($tmpexPageIds as $id) {
                if ($id) {
                    $exPageIds[] = $id;
                }
            }

            /** Checks if the site's folder is that of MelisSite or Vendor */
            $moduleDirectory = null;
            if (is_dir($_SERVER['DOCUMENT_ROOT'] . self::MELIS_SITES . $moduleName)) {
                /** Module is located inside MelisSites folder */
                $moduleDirectory = $_SERVER['DOCUMENT_ROOT'] . self::MELIS_SITES;
            } elseif (is_dir($_SERVER['DOCUMENT_ROOT'] . self::VENDOR . $moduleName)) {
                /** Module is located inside Vendor folder */
                $moduleDirectory = $_SERVER['DOCUMENT_ROOT'] . self::VENDOR;
            }

            $status = $searchIndex->createIndex($moduleName, $pageId, $exPageIds, $moduleDirectory);
        }

        $view = new ViewModel();
        $view->setTerminal(true);
        $view->status = $status;

        return $view;
    }