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

Change subject: Implement missing setMaxNgramsExtracted method
......................................................................


Implement missing setMaxNgramsExtracted method

Bug: T132625
Change-Id: I8b217b73383365a62f4b46eea7d9f2b57f3b6b7e
---
M includes/Extra/Filter/SourceRegex.php
M includes/Searcher.php
2 files changed, 11 insertions(+), 2 deletions(-)

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



diff --git a/includes/Extra/Filter/SourceRegex.php 
b/includes/Extra/Filter/SourceRegex.php
index a748d0c..15dd1f6 100644
--- a/includes/Extra/Filter/SourceRegex.php
+++ b/includes/Extra/Filter/SourceRegex.php
@@ -139,4 +139,13 @@
     public function setLocale( $locale ) {
         return $this->setParam( 'locale', $locale );
     }
+
+       /**
+        * @param int $maxNgrams The maximum number of ngrams to extracted from 
the 
+        *  regex. If more could be extracted from the regex tey are ignored.
+        * @return $this
+        */
+       public function setMaxNgramsExtracted( $maxNgrams ) {
+               return $this->setParam( 'max_ngrams_extracted', $maxNgrams );
+       }
 }
diff --git a/includes/Searcher.php b/includes/Searcher.php
index f92ccd3..67bb481 100644
--- a/includes/Searcher.php
+++ b/includes/Searcher.php
@@ -450,8 +450,8 @@
                                                $filter->setMaxInspect( 10000 );
                                        }
                                        $filter->setMaxDeterminizedStates( 
$this->config->get( 'CirrusSearchRegexMaxDeterminizedStates' ) );
-                                       if ( isset( $regex[ 
'max_ngrams_extracted' ] ) ) {
-                                               $filter->setMaxNgramExtracted( 
$regex[ 'max_ngrams_extracted' ] );
+                                       if ( isset( 
$regex['max_ngrams_extracted'] ) ) {
+                                               $filter->setMaxNgramsExtracted( 
$regex['max_ngrams_extracted'] );
                                        }
                                        $filter->setCaseSensitive( 
!$insensitive );
                                        $filter->setLocale( $this->config->get( 
'LanguageCode' ) );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8b217b73383365a62f4b46eea7d9f2b57f3b6b7e
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: EBernhardson <ebernhard...@wikimedia.org>
Gerrit-Reviewer: Cindy-the-browser-test-bot <bernhardsone...@gmail.com>
Gerrit-Reviewer: DCausse <dcau...@wikimedia.org>
Gerrit-Reviewer: Gehel <gleder...@wikimedia.org>
Gerrit-Reviewer: Manybubbles <never...@wikimedia.org>
Gerrit-Reviewer: MaxSem <maxsem.w...@gmail.com>
Gerrit-Reviewer: Smalyshev <smalys...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to