public function optimizeIndex($moduleName)
    {
        $translator = $this->getServiceLocator()->get('translator');
        $status = $translator->translate('tr_melis_engine_search_optimize');
        $lucenePath = self::FOLDER_PATH.$moduleName.'/'.self::FOLDER_NAME . '/indexes';

        if(file_exists($lucenePath) && is_readable($lucenePath)) {
            $index = Lucene::open($lucenePath);
            $index->optimize();
        }

        return $status;

    }
public function optimizeIndex($moduleName)
    {
        $translator = $this->getServiceLocator()->get('translator');
        $status = $translator->translate('tr_melis_engine_search_optimize');
        $lucenePath = self::FOLDER_PATH.$moduleName.'/'.self::FOLDER_NAME . '/indexes';

        if(file_exists($lucenePath) && is_readable($lucenePath)) {
            $index = Lucene::open($lucenePath);
            $index->optimize();
        }

        return $status;

    }
public function optimizeIndex ( $ moduleName ) { $ translator = $ this -> getServiceLocator ( ) -> get ( 'translator' ) ; $ status = $ translator -> translate ( 'tr_melis_engine_search_optimize' ) ; $ lucenePath = self :: FOLDER_PATH . $ moduleName . '/' . self :: FOLDER_NAME . '/indexes' ; if ( file_exists ( $ lucenePath ) && is_readable ( $ lucenePath ) ) { $ index = Lucene :: open ( $ lucenePath ) ; $ index -> optimize ( ) ; } return $ status ; }
Use this function to optimize your lucene indexes

@param string $moduleName
Use this function to optimize your lucene indexes