DCausse has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/318263

Change subject: Fix errors when searching out of the allowed limits
......................................................................

Fix errors when searching out of the allowed limits

This bug was only affecting italian wikis where interwiki is enabled.
But now the code has been refactored and it happens on all wikis.
Removed the constraint on EmptyResultSet to allow setting interwiki
results because apparently we ignore limit/offset here.

Bug: T149254
Change-Id: Ide819282f9437fd69fd7fe3751b4eace976b369e
---
M includes/Search/EmptyResultSet.php
M includes/Searcher.php
2 files changed, 5 insertions(+), 26 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CirrusSearch 
refs/changes/63/318263/1

diff --git a/includes/Search/EmptyResultSet.php 
b/includes/Search/EmptyResultSet.php
index acfbefd..7860602 100644
--- a/includes/Search/EmptyResultSet.php
+++ b/includes/Search/EmptyResultSet.php
@@ -83,31 +83,6 @@
        }
 
        /**
-        * @param ResultSet $res
-        * @param int $type One of SearchResultSet::* constants
-        * @param string $interwiki
-        */
-       public function addInterwikiResults( ResultSet $res, $type, $interwiki 
) {
-               throw new \RuntimeException( "Can't add interwiki results to 
empty result set" );
-       }
-
-       /**
-        * @param int $type
-        * @return SearchResultSet[]
-        */
-       public function getInterwikiResults( $type = 
SearchResultSet::SECONDARY_RESULTS ) {
-               return [];
-       }
-
-       /**
-        * @param int $type
-        * @return bool
-        */
-       public function hasInterwikiResults( $type = 
SearchResultSet::SECONDARY_RESULTS ) {
-               return false;
-       }
-
-       /**
         * @return bool
         */
        public function searchContainedSyntax() {
diff --git a/includes/Searcher.php b/includes/Searcher.php
index 8df1e4a..f945de8 100644
--- a/includes/Searcher.php
+++ b/includes/Searcher.php
@@ -609,7 +609,11 @@
                                                'result' => [],
                                ] );
                        } else {
-                               return Status::newGood( 
$this->resultsType->createEmptyResult() );
+                               $retval = [];
+                               foreach ( $searches as $key => $search ) {
+                                       $retval[$key] = 
$this->resultsType->createEmptyResult();
+                               }
+                               return Status::newGood( $retval );
                        }
                }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ide819282f9437fd69fd7fe3751b4eace976b369e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: DCausse <dcau...@wikimedia.org>

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

Reply via email to