Chad has uploaded a new change for review.
https://gerrit.wikimedia.org/r/159540
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, 10 insertions(+), 2 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/40/159540/1
diff --git a/includes/api/ApiQuerySearch.php b/includes/api/ApiQuerySearch.php
index 6c50237..50252c8 100644
--- a/includes/api/ApiQuerySearch.php
+++ b/includes/api/ApiQuerySearch.php
@@ -67,6 +67,14 @@
$searchInfo = array_flip( $params['info'] );
$prop = array_flip( $params['prop'] );
+ // Deprecated parameters
+ if ( isset( $prop['hasrelated'] ) ) {
+ $this->logFeatureUsage(
'action=search&srprop=hasrelated' );
+ }
+ if ( isset( $prop['score'] ) ) {
+ $this->logFeatureUsage( 'action=search&srprop=score' );
+ }
+
// 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 +337,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: newchange
Gerrit-Change-Id: I000b91ff4d81dc1563231cd3ae0b56952b9574fd
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Chad <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits