DCausse has uploaded a new change for review.

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

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
(cherry picked from commit 0075ab4799dc350efdaecfba8f2bd8576c0aa431)
---
M includes/ElasticsearchIntermediary.php
1 file changed, 2 insertions(+), 2 deletions(-)


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

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/280669
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I978efcfc7d881db647b68b2b6feeb5e5aae54e5b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: wmf/1.27.0-wmf.19
Gerrit-Owner: DCausse <[email protected]>

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

Reply via email to