Gehel has submitted this change and it was merged.

Change subject: Ignore ResultSets that do not return pages
......................................................................


Ignore ResultSets that do not return pages

It happens for geo and namespace queries but could maybe happen in other cases.
We should simply ignore such responses when building the list of hits we want
to store in CirrusSearchRequestSet.

bug: T131283
Change-Id: I978efcfc7d881db647b68b2b6feeb5e5aae54e5b
---
M includes/ElasticsearchIntermediary.php
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Gehel: Looks good to me, approved
  Cindy-the-browser-test-bot: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/includes/ElasticsearchIntermediary.php 
b/includes/ElasticsearchIntermediary.php
index 5af76e4..e48ff0b 100644
--- a/includes/ElasticsearchIntermediary.php
+++ b/includes/ElasticsearchIntermediary.php
@@ -676,11 +676,11 @@
                                $params['hitsOffset'] = intval( $offset );
                                $params['hits'] = array();
                                foreach ( $resultData['hits']['hits'] as $hit ) 
{
-                                       // @fixme: temporary plug
                                        if ( !isset( 
$hit['_source']['namespace'] )
                                                || !isset( 
$hit['_source']['title'] )
                                        ) {
-                                               wfDebugLog( 'AdHocDebug', 
'Unexpected search hit: ' . print_r( $hit, true ) );
+                                               // This is probably a query 
that does not return pages
+                                               // like geo or namespace queries
                                                continue;
                                        }
                                        // duplication of work ... this happens 
in the transformation

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I978efcfc7d881db647b68b2b6feeb5e5aae54e5b
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: DCausse <[email protected]>
Gerrit-Reviewer: Cindy-the-browser-test-bot <[email protected]>
Gerrit-Reviewer: EBernhardson <[email protected]>
Gerrit-Reviewer: Gehel <[email protected]>
Gerrit-Reviewer: Manybubbles <[email protected]>
Gerrit-Reviewer: Smalyshev <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to