jenkins-bot has submitted this change and it was merged.

Change subject: Properly deprecate srprop=score|hasrelated
......................................................................


Properly deprecate srprop=score|hasrelated

Logs stats on usage, output param descriptions for callers.

Change-Id: I000b91ff4d81dc1563231cd3ae0b56952b9574fd
---
M includes/api/ApiQuerySearch.php
1 file changed, 12 insertions(+), 2 deletions(-)

Approvals:
  Anomie: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/api/ApiQuerySearch.php b/includes/api/ApiQuerySearch.php
index 6c50237..b7dcd0e 100644
--- a/includes/api/ApiQuerySearch.php
+++ b/includes/api/ApiQuerySearch.php
@@ -67,6 +67,16 @@
                $searchInfo = array_flip( $params['info'] );
                $prop = array_flip( $params['prop'] );
 
+               // Deprecated parameters
+               if ( isset( $prop['hasrelated'] ) ) {
+                       $this->logFeatureUsage( 
'action=search&srprop=hasrelated' );
+                       $this->setWarning( 'srprop=hasrelated has been 
deprecated' );
+               }
+               if ( isset( $prop['score'] ) ) {
+                       $this->logFeatureUsage( 'action=search&srprop=score' );
+                       $this->setWarning( 'srprop=score has been deprecated' );
+               }
+
                // Create search engine instance and set options
                $search = isset( $params['backend'] ) && $params['backend'] != 
self::BACKEND_NULL_PARAM ?
                        SearchEngine::create( $params['backend'] ) : 
SearchEngine::create();
@@ -329,14 +339,14 @@
                                ' size             - Adds the size of the page 
in bytes',
                                ' wordcount        - Adds the word count of the 
page',
                                ' timestamp        - Adds the timestamp of when 
the page was last edited',
-                               ' score            - Adds the score (if any) 
from the search engine',
+                               ' score            - DEPRECATED and IGNORED',
                                ' snippet          - Adds a parsed snippet of 
the page',
                                ' titlesnippet     - Adds a parsed snippet of 
the page title',
                                ' redirectsnippet  - Adds a parsed snippet of 
the redirect title',
                                ' redirecttitle    - Adds the title of the 
matching redirect',
                                ' sectionsnippet   - Adds a parsed snippet of 
the matching section title',
                                ' sectiontitle     - Adds the title of the 
matching section',
-                               ' hasrelated       - Indicates whether a 
related search is available',
+                               ' hasrelated       - DEPRECATED and IGNORED',
                        ),
                        'offset' => 'Use this value to continue paging (return 
by query)',
                        'limit' => 'How many total pages to return',

-- 
To view, visit https://gerrit.wikimedia.org/r/159540
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I000b91ff4d81dc1563231cd3ae0b56952b9574fd
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Chad <ch...@wikimedia.org>
Gerrit-Reviewer: Anomie <bjor...@wikimedia.org>
Gerrit-Reviewer: Chad <ch...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to