Manybubbles has uploaded a new change for review.

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

Change subject: WIP: Highlight in chains
......................................................................

WIP: Highlight in chains

This will prevent Elasticsearch from trying to highlight fields that we're
not going to use because a field "before" it was highlighted.

Doesn't do anything unless you have I0326baaf497a305348eb536461cd8d6404795d2c
deployed to the Elasticsearch cluster.

Change-Id: Ib2d9713e9b9feae04f332cc8ca618e063e9a64c4
---
M includes/Search/ResultsType.php
1 file changed, 4 insertions(+), 0 deletions(-)


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

diff --git a/includes/Search/ResultsType.php b/includes/Search/ResultsType.php
index 50fac2e..0172f9e 100644
--- a/includes/Search/ResultsType.php
+++ b/includes/Search/ResultsType.php
@@ -286,13 +286,17 @@
                }
                if ( $this->highlightingConfig & self::HIGHLIGHT_ALT_TITLE ) {
                        $config[ 'fields' ][ 'redirect.title' ] = 
$entireValueInListField;
+                       $config[ 'fields' ][ 'redirect.title' ][ 'options' ][ 
'skip_if_last_matched' ] = true;
                        $config[ 'fields' ][ 'heading' ] = 
$entireValueInListField;
+                       $config[ 'fields' ][ 'heading' ][ 'options' ][ 
'skip_if_last_matched' ] = true;
                }
                if ( $this->highlightingConfig & self::HIGHLIGHT_SNIPPET ) {
                        $config[ 'fields' ][ 'text' ] = $text;
                        $config[ 'fields' ][ 'auxiliary_text' ] = 
$singleFragment;
+                       $config[ 'fields' ][ 'auxiliary_text' ][ 'options' ][ 
'skip_if_last_matched' ] = true;
                        if ( $this->highlightingConfig & 
self::HIGHLIGHT_FILE_TEXT ) {
                                $config[ 'fields' ][ 'file_text' ] = 
$singleFragment;
+                               $config[ 'fields' ][ 'file_text' ][ 'options' 
][ 'skip_if_last_matched' ] = true;
                        }
                }
                $config[ 'fields' ] = $this->addMatchedFields( $config[ 
'fields' ] );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib2d9713e9b9feae04f332cc8ca618e063e9a64c4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: Manybubbles <never...@wikimedia.org>

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

Reply via email to