Manybubbles has uploaded a new change for review.
https://gerrit.wikimedia.org/r/74668
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(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CirrusSearch
refs/changes/68/74668/1
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: newchange
Gerrit-Change-Id: I6f9a4bf91faeee512c3d5915f2f399501ab5b241
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: Manybubbles <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits