Remove "related" searches
[lhc/web/wiklou.git] / includes / api / ApiQuerySearch.php
index 1c41113..6c50237 100644 (file)
@@ -157,9 +157,6 @@ class ApiQuerySearch extends ApiQueryGeneratorBase {
                                if ( isset( $prop['timestamp'] ) ) {
                                        $vals['timestamp'] = wfTimestamp( TS_ISO_8601, $result->getTimestamp() );
                                }
-                               if ( !is_null( $result->getScore() ) && isset( $prop['score'] ) ) {
-                                       $vals['score'] = $result->getScore();
-                               }
                                if ( isset( $prop['titlesnippet'] ) ) {
                                        $vals['titlesnippet'] = $result->getTitleSnippet( $terms );
                                }
@@ -179,9 +176,6 @@ class ApiQuerySearch extends ApiQueryGeneratorBase {
                                                $vals['sectionsnippet'] = $result->getSectionSnippet();
                                        }
                                }
-                               if ( isset( $prop['hasrelated'] ) && $result->hasRelated() ) {
-                                       $vals['hasrelated'] = '';
-                               }
 
                                // Add item to results and see whether it fits
                                $fit = $apiResult->addValue( array( 'query', $this->getModuleName() ),
@@ -200,7 +194,6 @@ class ApiQuerySearch extends ApiQueryGeneratorBase {
                $hasInterwikiResults = false;
                if ( $interwiki && $resultPageSet === null && $matches->hasInterwikiResults() ) {
                        $matches = $matches->getInterwikiResults();
-                       $iwprefixes = array();
                        $hasInterwikiResults = true;
 
                        // Include number of results if requested
@@ -357,75 +350,10 @@ class ApiQuerySearch extends ApiQueryGeneratorBase {
                return $descriptions;
        }
 
-       public function getResultProperties() {
-               return array(
-                       '' => array(
-                               'ns' => 'namespace',
-                               'title' => 'string'
-                       ),
-                       'snippet' => array(
-                               'snippet' => 'string'
-                       ),
-                       'size' => array(
-                               'size' => 'integer'
-                       ),
-                       'wordcount' => array(
-                               'wordcount' => 'integer'
-                       ),
-                       'timestamp' => array(
-                               'timestamp' => 'timestamp'
-                       ),
-                       'score' => array(
-                               'score' => array(
-                                       ApiBase::PROP_TYPE => 'string',
-                                       ApiBase::PROP_NULLABLE => true
-                               )
-                       ),
-                       'titlesnippet' => array(
-                               'titlesnippet' => 'string'
-                       ),
-                       'redirecttitle' => array(
-                               'redirecttitle' => array(
-                                       ApiBase::PROP_TYPE => 'string',
-                                       ApiBase::PROP_NULLABLE => true
-                               )
-                       ),
-                       'redirectsnippet' => array(
-                               'redirectsnippet' => array(
-                                       ApiBase::PROP_TYPE => 'string',
-                                       ApiBase::PROP_NULLABLE => true
-                               )
-                       ),
-                       'sectiontitle' => array(
-                               'sectiontitle' => array(
-                                       ApiBase::PROP_TYPE => 'string',
-                                       ApiBase::PROP_NULLABLE => true
-                               )
-                       ),
-                       'sectionsnippet' => array(
-                               'sectionsnippet' => array(
-                                       ApiBase::PROP_TYPE => 'string',
-                                       ApiBase::PROP_NULLABLE => true
-                               )
-                       ),
-                       'hasrelated' => array(
-                               'hasrelated' => 'boolean'
-                       )
-               );
-       }
-
        public function getDescription() {
                return 'Perform a full text search.';
        }
 
-       public function getPossibleErrors() {
-               return array_merge( parent::getPossibleErrors(), array(
-                       array( 'code' => 'search-text-disabled', 'info' => 'text search is disabled' ),
-                       array( 'code' => 'search-title-disabled', 'info' => 'title search is disabled' ),
-                       array( 'code' => 'search-error', 'info' => 'search error has occurred' ),
-               ) );
-       }
-
        public function getExamples() {
                return array(
                        'api.php?action=query&list=search&srsearch=meaning',