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

Change subject: Don't complain when there is no suggestion data.
......................................................................


Don't complain when there is no suggestion data.

This happens when your search is entirely composed of filters like this
one: "incategory:stuff_my_cats_like".

Change-Id: I6f9a4bf91faeee512c3d5915f2f399501ab5b241
---
M CirrusSearch.body.php
1 file changed, 3 insertions(+), 0 deletions(-)

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



diff --git a/CirrusSearch.body.php b/CirrusSearch.body.php
index fa42d21..807063b 100644
--- a/CirrusSearch.body.php
+++ b/CirrusSearch.body.php
@@ -345,6 +345,9 @@
        private function findSuggestionQuery() {
                // TODO some kind of weighting?
                $suggest = $this->result->getResponse()->getData();
+               if ( !array_key_exists( 'suggest', $suggest ) ) {
+                       return null;
+               }
                $suggest = $suggest[ 'suggest' ];
                foreach ( $suggest[ CirrusSearch::PHRASE_TITLE ][ 0 ][ 
'options' ] as $option ) {
                        return $option[ 'text' ];

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I6f9a4bf91faeee512c3d5915f2f399501ab5b241
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: Manybubbles <[email protected]>
Gerrit-Reviewer: Demon <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to