public function performSearch()
    {
        try {
            $index = Zend_Search_Lucene::open(self::get_index_location());

            Zend_Search_Lucene::setResultSetLimit(100);
            
            $query = new Zend_Search_Lucene_Search_Query_Boolean();
            $term = Zend_Search_Lucene_Search_QueryParser::parse($this->getQuery());
            $query->addSubquery($term, true);
            
            if ($this->modules) {
                $moduleQuery = new Zend_Search_Lucene_Search_Query_MultiTerm();
                
                foreach ($this->modules as $module) {
                    $moduleQuery->addTerm(new Zend_Search_Lucene_Index_Term($module, 'Entity'));
                }
                
                $query->addSubquery($moduleQuery, true);
            }

            if ($this->versions) {
                $versionQuery = new Zend_Search_Lucene_Search_Query_MultiTerm();
                
                foreach ($this->versions as $version) {
                    $versionQuery->addTerm(new Zend_Search_Lucene_Index_Term($version, 'Version'));
                }
                
                $query->addSubquery($versionQuery, true);
            }
            
            $er = error_reporting();
            error_reporting('E_ALL ^ E_NOTICE');
            $this->results = $index->find($query);
            error_reporting($er);
            $this->totalResults = $index->numDocs();
        } catch (Zend_Search_Lucene_Exception $e) {
            user_error($e .'. Ensure you have run the rebuld task (/dev/tasks/RebuildLuceneDocsIndex)', E_USER_ERROR);
        }
    }
public function performSearch()
    {
        try {
            $index = Zend_Search_Lucene::open(self::get_index_location());

            Zend_Search_Lucene::setResultSetLimit(100);
            
            $query = new Zend_Search_Lucene_Search_Query_Boolean();
            $term = Zend_Search_Lucene_Search_QueryParser::parse($this->getQuery());
            $query->addSubquery($term, true);
            
            if ($this->modules) {
                $moduleQuery = new Zend_Search_Lucene_Search_Query_MultiTerm();
                
                foreach ($this->modules as $module) {
                    $moduleQuery->addTerm(new Zend_Search_Lucene_Index_Term($module, 'Entity'));
                }
                
                $query->addSubquery($moduleQuery, true);
            }

            if ($this->versions) {
                $versionQuery = new Zend_Search_Lucene_Search_Query_MultiTerm();
                
                foreach ($this->versions as $version) {
                    $versionQuery->addTerm(new Zend_Search_Lucene_Index_Term($version, 'Version'));
                }
                
                $query->addSubquery($versionQuery, true);
            }
            
            $er = error_reporting();
            error_reporting('E_ALL ^ E_NOTICE');
            $this->results = $index->find($query);
            error_reporting($er);
            $this->totalResults = $index->numDocs();
        } catch (Zend_Search_Lucene_Exception $e) {
            user_error($e .'. Ensure you have run the rebuld task (/dev/tasks/RebuildLuceneDocsIndex)', E_USER_ERROR);
        }
    }
public function performSearch ( ) { try { $ index = Zend_Search_Lucene :: open ( self :: get_index_location ( ) ) ; Zend_Search_Lucene :: setResultSetLimit ( 100 ) ; $ query = new Zend_Search_Lucene_Search_Query_Boolean ( ) ; $ term = Zend_Search_Lucene_Search_QueryParser :: parse ( $ this -> getQuery ( ) ) ; $ query -> addSubquery ( $ term , true ) ; if ( $ this -> modules ) { $ moduleQuery = new Zend_Search_Lucene_Search_Query_MultiTerm ( ) ; foreach ( $ this -> modules as $ module ) { $ moduleQuery -> addTerm ( new Zend_Search_Lucene_Index_Term ( $ module , 'Entity' ) ) ; } $ query -> addSubquery ( $ moduleQuery , true ) ; } if ( $ this -> versions ) { $ versionQuery = new Zend_Search_Lucene_Search_Query_MultiTerm ( ) ; foreach ( $ this -> versions as $ version ) { $ versionQuery -> addTerm ( new Zend_Search_Lucene_Index_Term ( $ version , 'Version' ) ) ; } $ query -> addSubquery ( $ versionQuery , true ) ; } $ er = error_reporting ( ) ; error_reporting ( 'E_ALL ^ E_NOTICE' ) ; $ this -> results = $ index -> find ( $ query ) ; error_reporting ( $ er ) ; $ this -> totalResults = $ index -> numDocs ( ) ; } catch ( Zend_Search_Lucene_Exception $ e ) { user_error ( $ e . '. Ensure you have run the rebuld task (/dev/tasks/RebuildLuceneDocsIndex)' , E_USER_ERROR ) ; } }
Perform a search query on the index
Perform a search query on the index