EBernhardson has uploaded a new change for review.
https://gerrit.wikimedia.org/r/284345
Change subject: Spelling corrections
......................................................................
Spelling corrections
Bug: T132625
Change-Id: Id5ba17edd17fbd4de926daa47312c1414a611287
---
M CirrusSearch.php
M README
M autoload.php
M includes/BuildDocument/PageDataBuilder.php
M includes/BuildDocument/PageTextBuilder.php
M includes/BuildDocument/SuggestBuilder.php
M includes/BuildDocument/SuggestScoring.php
M includes/CirrusSearch.php
M includes/CompletionSuggester.php
M includes/Connection.php
M includes/DataSender.php
M includes/ElasticsearchIntermediary.php
M includes/Extra/Filter/SourceRegex.php
M includes/Hooks.php
M includes/InterwikiSearcher.php
M includes/Job/ElasticaWrite.php
M includes/Job/IncomingLinkCount.php
M includes/Maintenance/AnalysisConfigBuilder.php
M includes/Maintenance/ConfigUtils.php
M includes/Maintenance/MappingConfigBuilder.php
M includes/Sanity/Remediator.php
M includes/Search/Escaper.php
M includes/Search/RescoreBuilders.php
M includes/Search/Result.php
M includes/Search/ResultsType.php
M includes/Search/SearchContext.php
M includes/Search/SearchTextQueryBuilders.php
M includes/Searcher.php
M includes/Updater.php
M includes/UserTesting.php
M includes/Util.php
M maintenance/checkIndexes.php
M maintenance/cirrusNeedsToBeBuilt.php
M maintenance/dumpIndex.php
M maintenance/forceSearchIndex.php
M maintenance/updateSearchIndexConfig.php
M maintenance/updateSuggesterIndex.php
M profiles/PhraseSuggesterProfiles.php
M profiles/RescoreProfiles.php
39 files changed, 104 insertions(+), 104 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CirrusSearch
refs/changes/45/284345/1
diff --git a/CirrusSearch.php b/CirrusSearch.php
index 0cc219f..cba4dbd 100644
--- a/CirrusSearch.php
+++ b/CirrusSearch.php
@@ -46,7 +46,7 @@
// clusters this should be pointed to the closest cluster, and
// can be pointed at an alternate cluster during downtime.
//
-// As a form of backwards compatability the existence of
+// As a form of backwards compatibility the existence of
// $wgCirrusSearchServers will override all cluster configuration.
$wgCirrusSearchDefaultCluster = 'default';
@@ -60,7 +60,7 @@
//
// $wgCirrusSearchClusters = array(
// 'eqiad' => array( 'es01.eqiad.wmnet', 'es02.eqiad.wmnet' ),
-// 'codfw' => array( 'es01.codwf.wmnet', 'es02.codfw.wmnet' ),
+// 'codfw' => array( 'es01.codfw.wmnet', 'es02.codfw.wmnet' ),
// );
$wgCirrusSearchClusters = array(
'default' => array( 'localhost' ),
@@ -109,7 +109,7 @@
// How many seconds must a search of Elasticsearch be before we consider it
// slow? Default value is 10 seconds which should be fine for catching the
rare
-// truely abusive queries. Use Elasticsearch query more granular logs that
+// truly abusive queries. Use Elasticsearch query more granular logs that
// don't contain user information.
$wgCirrusSearchSlowSearch = 10.0;
@@ -142,7 +142,7 @@
// 'build' in the array then regex will fail to find anything. The value of
// the 'max_inspect' key is the maximum number of pages to recheck the regex
// against. Its optional and defaults to 10000 which seems like a reasonable
-// compromize to keep regexes fast while still producing good results.
+// compromise to keep regexes fast while still producing good results.
// This example enables the safer query's phrase processing:
// $wgCirrusSearchWikimediaExtraPlugin[ 'safer' ] = array(
// 'phrase' => array(
@@ -161,7 +161,7 @@
// extra plugin installed. Sometimes they still cause issues though.
$wgCirrusSearchEnableRegex = true;
-// Maximum complexity of regexes. Raising this will allow more compelex
+// Maximum complexity of regexes. Raising this will allow more complex
// regexes use the memory that they need to compile in Elasticsearch. The
// default allows reasonably complex regexes and doesn't use _too_ much memory.
$wgCirrusSearchRegexMaxDeterminizedStates = 20000;
@@ -247,13 +247,13 @@
'regex' => 240,
);
-// Client side timeout for maintanance operations. We can't disable the
timeout
+// Client side timeout for maintenance operations. We can't disable the
timeout
// all together so we set it to one hour for really long running operations
// like optimize.
$wgCirrusSearchMaintenanceTimeout = 3600;
// Is it ok if the prefix starts on any word in the title or just the first
word?
-// Defaults to false (first word only) because that is the wikipedia behavior
and so
+// Defaults to false (first word only) because that is the Wikipedia behavior
and so
// what we expect users to expect. Does not effect the prefix: search filter
or
// url parameter - that always starts with the first word. false -> true will
break
// prefix searching until an in place reindex is complete. true -> false is
fine
@@ -304,7 +304,7 @@
// Set the hard limit for $wgCirrusSearchPhraseMaxTermFreq. This prevents
customizing
// this setting in a way that could hurt the system performances.
-$wgCirrusSearchPhraseSugggestMaxTermFreqHardLimit = 0.6;
+$wgCirrusSearchPhraseSuggestMaxTermFreqHardLimit = 0.6;
// List of allowed values for the suggest mode
$wgCirrusSearchPhraseSuggestAllowedMode = array( 'missing', 'popular',
'always' );
@@ -370,7 +370,7 @@
// Enable building and using of "all" fields that contain multiple copies of
other fields
// for weighting. These all fields exist entirely to speed up the full_text
query type by
-// baking the weights above into a single field. This is useful because it
drasticly
+// baking the weights above into a single field. This is useful because it
drastically
// reduces the random io to power the query from 14 term queries per term in
the query
// string to 2. Each term query is potentially one or two disk random io
actions. The
// reduction isn't strictly 7:1 because we skip file_text in non file
namespace (now 6:1)
@@ -399,10 +399,10 @@
$wgCirrusSearchStemmedWeight = 0.5;
// Weight of each namespace relative to NS_MAIN. If not specified non-talk
namespaces default to
-// $wgCirrusSearchDefaultNamespaceWeight. If not specified talk namspaces
default to:
+// $wgCirrusSearchDefaultNamespaceWeight. If not specified talk namespaces
default to:
// $wgCirrusSearchTalkNamespaceWeight * weightOfCorrespondingNonTalkNamespace
// The default values below inspired by the configuration used for lsearchd.
Note that _technically_
-// NS_MAIN can be overriden with this then 1 just represents what NS_MAIN
would have been....
+// NS_MAIN can be overridden with this then 1 just represents what NS_MAIN
would have been....
// If you override NS_MAIN here then NS_TALK will still default to:
// $wgCirrusSearchNamespaceWeights[ NS_MAIN ] *
wgCirrusSearchTalkNamespaceWeight
// You can specify namespace by number or string. Strings are converted to
numbers using the
@@ -454,7 +454,7 @@
'min_doc_freq' => 2,
// Maximum number of documents (per shard) that have a term for it to
be considered
- // Setting a sufficient high value can be usefull to exclude stop words
but it depends on the wiki size.
+ // Setting a sufficient high value can be useful to exclude stop words
but it depends on the wiki size.
'max_doc_freq' => null,
// This is the max number it will collect from input data to build the
query
@@ -508,7 +508,7 @@
// query.
// Note that if the all field is used then this setting will be forced to true.
// This is because the all field is not part of the _source and its content
cannot
-// be retreived by elasticsearch.
+// be retrieved by elasticsearch.
$wgCirrusSearchMoreLikeThisUseFields = false;
// More like this is a very expensive query. This allows redirecting queries
@@ -644,7 +644,7 @@
'stemmedWeight',
'namespaceWeights',
'defaultNamespaceWeight',
- 'talkeNamespaceWeight',
+ 'talkNamespaceWeight',
'languageWeight',
'preferRecentDefaultDecayPortion',
'preferRecentUnspecifiedDecayPortion',
@@ -775,7 +775,7 @@
$wgCirrusSearchCompletionDefaultScore = 'quality';
/**
- * Use the completion suggester as the default implemention for
searchSuggestions.
+ * Use the completion suggester as the default implementation for
searchSuggestions.
* You have to build the completion suggester index with the maintenance script
* updateSuggesterIndex.php. The suggester only supports queries to the main
* namespace. PrefixSearch will be used in all other cases.
diff --git a/README b/README
index 1e9ebd6..e4e3862 100644
--- a/README
+++ b/README
@@ -6,7 +6,7 @@
Get Elasticsearch up and running somewhere. 1.3.2 and above are all fine
though soon it'll be 1.6+.
CirrusSearch still uses dynamic scripts. Its very close to not needing them
any more - probably by
-August 2015 it won't. Anyway, for now you'll have to reenable dynamic
scripting in Elasticsearch. Do
+August 2015 it won't. Anyway, for now you'll have to re-enable dynamic
scripting in Elasticsearch. Do
that by adding the contents of the elasticsearch.yml file in this directory to
the elasticsearch.yml
file that comes with your installation.
@@ -203,12 +203,12 @@
2. Configure Elasticsearch for memlock.
3. Change each node's elasticsearch.yml file in a few ways.
3a. Change node name to the real host name.
-3b. Turn off autocreation and some other scary stuff by adding this (tested
with 0.90.4):
+3b. Turn off auto creation and some other scary stuff by adding this (tested
with 0.90.4):
################################### Actions #################################
## Modulo some small changes to comments this section comes directly from the
## wonderful Elasticsearch mailing list, specifically Dan Everton.
##
- # Require explicit index creation. ES never autocreates the indexes the way
we
+ # Require explicit index creation. ES never auto creates the indexes the way
we
# like them.
##
action.auto_create_index: false
diff --git a/autoload.php b/autoload.php
index dd66d10..5740ccc 100644
--- a/autoload.php
+++ b/autoload.php
@@ -13,7 +13,7 @@
'CirrusSearch\\Api\\SuggestIndex' => __DIR__ .
'/includes/Api/SuggestIndex.php',
'CirrusSearch\\BuildDocument\\Builder' => __DIR__ .
'/includes/BuildDocument/Builder.php',
'CirrusSearch\\BuildDocument\\FileDataBuilder' => __DIR__ .
'/includes/BuildDocument/FileDataBuilder.php',
- 'CirrusSearch\\BuildDocument\\IncomingsLinksScoringMethod' => __DIR__ .
'/includes/BuildDocument/SuggestScoring.php',
+ 'CirrusSearch\\BuildDocument\\IncomingLinksScoringMethod' => __DIR__ .
'/includes/BuildDocument/SuggestScoring.php',
'CirrusSearch\\BuildDocument\\PQScore' => __DIR__ .
'/includes/BuildDocument/SuggestScoring.php',
'CirrusSearch\\BuildDocument\\PageDataBuilder' => __DIR__ .
'/includes/BuildDocument/PageDataBuilder.php',
'CirrusSearch\\BuildDocument\\PageTextBuilder' => __DIR__ .
'/includes/BuildDocument/PageTextBuilder.php',
diff --git a/includes/BuildDocument/PageDataBuilder.php
b/includes/BuildDocument/PageDataBuilder.php
index 0ea34fa..9c0ffce 100644
--- a/includes/BuildDocument/PageDataBuilder.php
+++ b/includes/BuildDocument/PageDataBuilder.php
@@ -97,7 +97,7 @@
$ignoredHeadings = $this->getIgnoredHeadings();
foreach ( $this->parserOutput->getSections() as $heading ) {
$heading = $heading[ 'line' ];
- // First strip out things that look like references.
We can't use HTML filtering becase
+ // First strip out things that look like references.
We can't use HTML filtering because
// the references come back as <sup> tags without a
class. To keep from breaking stuff like
// ==Applicability of the strict mass–energy
equivalence formula, ''E'' = ''mc''<sup>2</sup>==
// we don't remove the whole <sup> tag. We also don't
want to strip the <sup> tag and remove
diff --git a/includes/BuildDocument/PageTextBuilder.php
b/includes/BuildDocument/PageTextBuilder.php
index 35de492..3a99dac 100644
--- a/includes/BuildDocument/PageTextBuilder.php
+++ b/includes/BuildDocument/PageTextBuilder.php
@@ -32,7 +32,7 @@
private $excludedElementSelectors = array(
'audio', 'video', // "it looks like you don't have
javascript enabled..." do not need to index
'sup.reference', // The [1] for references
- '.mw-cite-backlink', // The ↑ next to refenences in the
references section
+ '.mw-cite-backlink', // The ↑ next to references in the
references section
'h1', 'h2', 'h3', // Headings are already indexed in
their own field.
'h5', 'h6', 'h4',
'.autocollapse', // Collapsed fields are hidden by
default so we don't want them showing up.
@@ -117,7 +117,7 @@
// Strip elements from the page that are auxiliary text. These
will still be
// searched but matches will be ranked lower and non-auxiliary
matches will be
- // prefered in highlighting.
+ // preferred in highlighting.
$formatter->remove( $this->auxiliaryElementSelectors );
$auxiliaryElements = $formatter->filterContent();
$allText = trim( Sanitizer::stripAllTags( $formatter->getText()
) );
diff --git a/includes/BuildDocument/SuggestBuilder.php
b/includes/BuildDocument/SuggestBuilder.php
index 5179628..94cc45e 100644
--- a/includes/BuildDocument/SuggestBuilder.php
+++ b/includes/BuildDocument/SuggestBuilder.php
@@ -45,7 +45,7 @@
const REDIRECT_DISCOUNT = 0.1;
/**
- * Discount suggestions based on crossnamespace redirects
+ * Discount suggestions based on cross namespace redirects
*/
const CROSSNS_DISCOUNT = 0.005;
@@ -490,8 +490,8 @@
}
/**
- * Decode a suggestion ouput.
- * The result is an array whith the following keys:
+ * Decode a suggestion output.
+ * The result is an array with the following keys:
* id: the pageId
* type: either REDIRECT_SUGGESTION or TITLE_SUGGESTION
* text (optional): if TITLE_SUGGESTION the Title text
diff --git a/includes/BuildDocument/SuggestScoring.php
b/includes/BuildDocument/SuggestScoring.php
index 2330b1e..c7dd9eb 100644
--- a/includes/BuildDocument/SuggestScoring.php
+++ b/includes/BuildDocument/SuggestScoring.php
@@ -34,7 +34,7 @@
public static function getScoringMethod( $scoringMethod ) {
switch( $scoringMethod ) {
case 'incomingLinks':
- return new IncomingsLinksScoringMethod();
+ return new IncomingLinksScoringMethod();
case 'quality':
return new QualityScore();
case 'popqual':
@@ -69,7 +69,7 @@
/**
* Very simple scoring method based on incoming links
*/
-class IncomingsLinksScoringMethod implements SuggestScoringMethod {
+class IncomingLinksScoringMethod implements SuggestScoringMethod {
/**
* {@inheritDoc}
*/
diff --git a/includes/CirrusSearch.php b/includes/CirrusSearch.php
index 7114e12..bf5992f 100644
--- a/includes/CirrusSearch.php
+++ b/includes/CirrusSearch.php
@@ -312,7 +312,7 @@
private function searchTextReal( $term, SearchConfig $config = null ) {
global $wgCirrusSearchInterwikiSources;
- // Convert the unicode character 'idiographic whitespace' into
standard
+ // Convert the unicode character 'ideographic whitespace' into
standard
// whitespace. Cirrussearch treats them both as normal
whitespace, but
// the preceding isn't appropriately trimmed.
$term = trim( str_replace( "\xE3\x80\x80", " ", $term) );
@@ -646,7 +646,7 @@
// There is no way to send errors or warnings back to the
caller here so we have to make do with
// only sending results back if there are results and relying
on the logging done at the status
- // constrution site to log errors.
+ // construction site to log errors.
if ( $status->isOK() ) {
if ( !$search ) {
// No need to unpack the simple title matches
from non-fancy TitleResultsType
diff --git a/includes/CompletionSuggester.php b/includes/CompletionSuggester.php
index f6e6d07..4a7ee7b 100644
--- a/includes/CompletionSuggester.php
+++ b/includes/CompletionSuggester.php
@@ -146,7 +146,7 @@
User $user = null, $index = false ) {
if ( is_null( $config ) ) {
- // @todo connection has an embeded config ... reuse
that? somehow should
+ // @todo connection has an embedded config ... reuse
that? somehow should
// at least ensure they are the same.
$config = MediaWikiServices::getInstance()
->getConfigFactory()
@@ -558,7 +558,7 @@
* Get the hard limit
* The completion api does not supports offset we have to add a hack
* here to work around this limitation.
- * To avoid ridiculously large queris we set also a hard limit.
+ * To avoid ridiculously large queries we set also a hard limit.
* Note that this limit will be changed by fetch_limit_factor set to 2
or 1.5
* depending on the profile.
* @return int the number of results to fetch from elastic
diff --git a/includes/Connection.php b/includes/Connection.php
index e620f2b..07f8259 100644
--- a/includes/Connection.php
+++ b/includes/Connection.php
@@ -151,7 +151,7 @@
* specifications.
*/
public function getServerList() {
- // This clause provides backwards compatability with previous
versions
+ // This clause provides backwards compatibility with previous
versions
// of CirrusSearch. Once this variable is removed cluster
configuration
// will work as expected.
if ( $this->config->has( 'CirrusSearchServers' ) ) {
diff --git a/includes/DataSender.php b/includes/DataSender.php
index 8dcea92..763c639 100644
--- a/includes/DataSender.php
+++ b/includes/DataSender.php
@@ -85,7 +85,7 @@
$bulk->send();
}
- // Ensure our freeze is immediatly seen (mostly for testing
+ // Ensure our freeze is immediately seen (mostly for testing
// purposes)
$type->getIndex()->refresh();
}
diff --git a/includes/ElasticsearchIntermediary.php
b/includes/ElasticsearchIntermediary.php
index e4e4390..572ae27 100644
--- a/includes/ElasticsearchIntermediary.php
+++ b/includes/ElasticsearchIntermediary.php
@@ -266,7 +266,7 @@
// useful while we are testing accept-lang
based interwiki
'acceptLang' => (string)
($wgRequest->getHeader( 'Accept-Language' ) ?: ''),
// Helps to track down what actually caused the
request. Will promote to full
- // param if it proves usefull
+ // param if it proves useful
'queryString' => http_build_query( $_GET ),
),
'requests' => $requests,
@@ -323,7 +323,7 @@
* Get a token that (hopefully) uniquely identifies this search. It
will be
* added to the search result page js config vars, and put into the url
with
* history.replaceState(). This means click through's from supported
browsers
- * will record this token as part of the referer.
+ * will record this token as part of the referrer.
*
* @return string
*/
@@ -442,7 +442,7 @@
}
/**
- * Log a succesful request when the response comes from a cache outside
elasticsearch.
+ * Log a successful request when the response comes from a cache
outside elasticsearch.
* @param string $description name of the action being started
* @param array $logContext Contextual variables for generating log
messages
*/
@@ -645,7 +645,7 @@
* format from elasticsearch. The completion suggester is a bit of a
* special snowflake in that it has a completely different response
* format than other searches. The CirrusSearch\CompletionSuggester
- * class is responsible for providing any usefull logging data by adding
+ * class is responsible for providing any useful logging data by adding
* directly to $this->logContext.
*
* @param float $took Number of milliseconds the request took
diff --git a/includes/Extra/Filter/SourceRegex.php
b/includes/Extra/Filter/SourceRegex.php
index 660df91..bf26856 100644
--- a/includes/Extra/Filter/SourceRegex.php
+++ b/includes/Extra/Filter/SourceRegex.php
@@ -70,10 +70,10 @@
}
/**
- * @param int $gramSize size of the ngrams extracted for acccelerating
- * the regex. Defaults to 3 if not set. That gram size must have been
- * produced by analyzing the ngramField.
- * @return \CirrusSearch\Extra\Filter\SourceRegex this for chaining
+ * @param int $gramSize size of the ngrams extracted for accelerating
+ * the regex. Defaults to 3 if not set. That gram size must have been
+ * produced by analyzing the ngramField.
+ * @return $this
*/
public function setGramSize( $gramSize ) {
return $this->setParam( 'gram_size', $gramSize );
@@ -132,9 +132,9 @@
}
/**
- * @param bool $locale locale used for case conversions. Its imporant that
- * this matches the locale used for lowercasing in the ngram index.
- * @return \CirrusSearch\Extra\Filter\SourceRegex this for chaining
+ * @param bool $locale locale used for case conversions. Its important
that
+ * this matches the locale used for lowercasing in the ngram index.
+ * @return $this
*/
public function setLocale( $locale ) {
return $this->setParam( 'locale', $locale );
diff --git a/includes/Hooks.php b/includes/Hooks.php
index 71f8fbf..6c70ca0 100644
--- a/includes/Hooks.php
+++ b/includes/Hooks.php
@@ -505,7 +505,7 @@
}
// There is no way to send errors or warnings back to the
caller here so we have to make do with
// only sending results back if there are results and relying
on the logging done at the status
- // constrution site to log errors.
+ // construction site to log errors.
if ( !$status->isOK() ) {
return true;
}
diff --git a/includes/InterwikiSearcher.php b/includes/InterwikiSearcher.php
index 326ea9e..03555ff 100644
--- a/includes/InterwikiSearcher.php
+++ b/includes/InterwikiSearcher.php
@@ -111,7 +111,7 @@
}
/**
- * We don't support extra indicies when we're doing interwiki searches
+ * We don't support extra indices when we're doing interwiki searches
*
* @see Searcher::getAndFilterExtraIndexes()
* @return array
diff --git a/includes/Job/ElasticaWrite.php b/includes/Job/ElasticaWrite.php
index dd0f944..f29590f 100644
--- a/includes/Job/ElasticaWrite.php
+++ b/includes/Job/ElasticaWrite.php
@@ -51,10 +51,10 @@
* numerous that if they were to start failing they would possibly
* overflow the job queue and bring down redis in production.
*
- * Basically we just can't let these jobs hang out in the abandonded
+ * Basically we just can't let these jobs hang out in the abandoned
* queue for a week like retries typically do. If these jobs get
* failed they will log to CirrusSearchChangeFailed which is a signal
- * that some point in time arround the failure needs to be reindexed
+ * that some point in time around the failure needs to be reindexed
* manually. See https://wikitech.wikimedia.org/wiki/Search for more
* details.
*/
diff --git a/includes/Job/IncomingLinkCount.php
b/includes/Job/IncomingLinkCount.php
index f1e499c..f85e6aa 100644
--- a/includes/Job/IncomingLinkCount.php
+++ b/includes/Job/IncomingLinkCount.php
@@ -29,7 +29,7 @@
// Load the titles and filter out any that no longer exist.
$updater = $this->createUpdater();
// We're intentionally throwing out whether or not this job
succeeds.
- // We're loggging it but we're not retrying.
+ // We're logging it but we're not retrying.
$updater->updateLinkedArticles( array( $this->getTitle() ) );
return true;
}
diff --git a/includes/Maintenance/AnalysisConfigBuilder.php
b/includes/Maintenance/AnalysisConfigBuilder.php
index b34bacf..626483d 100644
--- a/includes/Maintenance/AnalysisConfigBuilder.php
+++ b/includes/Maintenance/AnalysisConfigBuilder.php
@@ -234,7 +234,7 @@
'\u2019=>\u0020', // Unicode
right single quote
'\u02BC=>\u0020', // Unicode
modifier letter apostrophe
'_=>\u0020', // Mediawiki
loves _ and people are used to it but it usually means space
- '-=>\u0020', // Useful
for finding hypenated names unhypenated
+ '-=>\u0020', // Useful
for finding hyphenated names unhyphenated
),
),
// Converts things that don't always count as
word breaks into spaces which always
diff --git a/includes/Maintenance/ConfigUtils.php
b/includes/Maintenance/ConfigUtils.php
index 9f149bb..be715c8 100644
--- a/includes/Maintenance/ConfigUtils.php
+++ b/includes/Maintenance/ConfigUtils.php
@@ -74,7 +74,7 @@
return $identifier;
}
if ( $option === 'current' ) {
- $this->outputIndented( 'Infering index identifier...' );
+ $this->outputIndented( 'Inferring index identifier...'
);
$found = $this->getAllIndicesByType( $typeName );
if ( count( $found ) > 1 ) {
$this->output( "error\n" );
diff --git a/includes/Maintenance/MappingConfigBuilder.php
b/includes/Maintenance/MappingConfigBuilder.php
index 78aed81..5978954 100644
--- a/includes/Maintenance/MappingConfigBuilder.php
+++ b/includes/Maintenance/MappingConfigBuilder.php
@@ -88,7 +88,7 @@
$suggestExtra = array( 'analyzer' => 'suggest' );
// Note never to set something as type='object' here because
that isn't returned by elasticsearch
- // and is infered anyway.
+ // and is inferred anyway.
$titleExtraAnalyzers = array(
$suggestExtra,
array( 'index_analyzer' => 'prefix', 'search_analyzer'
=> 'near_match', 'index_options' => 'docs', 'norms' => array( 'enabled' =>
false ) ),
@@ -245,19 +245,19 @@
* @param string $analyzer
*/
private function getSimilarity( $field, $analyzer = null ) {
- $fieldSimilaraty = 'default';
+ $fieldSimilarity = 'default';
if ( isset( $this->similarity['fields'] ) ) {
if( isset( $this->similarity['fields'][$field] ) ) {
- $fieldSimilaraty =
$this->similarity['fields'][$field];
+ $fieldSimilarity =
$this->similarity['fields'][$field];
} else if ( $this->similarity['fields']['__default__']
) {
- $fieldSimilaraty =
$this->similarity['fields']['__default__'];
+ $fieldSimilarity =
$this->similarity['fields']['__default__'];
}
if ( $analyzer != null && isset(
$this->similarity['fields']["$field.$analyzer"] ) ) {
- $fieldSimilaraty =
$this->similarity['fields']["$field.$analyzer"];
+ $fieldSimilarity =
$this->similarity['fields']["$field.$analyzer"];
}
}
- return $fieldSimilaraty;
+ return $fieldSimilarity;
}
/**
diff --git a/includes/Sanity/Remediator.php b/includes/Sanity/Remediator.php
index 695caa4..8f0431f 100644
--- a/includes/Sanity/Remediator.php
+++ b/includes/Sanity/Remediator.php
@@ -79,7 +79,7 @@
/**
* Build the remediator.
- * @param Remediator $next the rememediator that this one decorates
+ * @param Remediator $next the remediator that this one decorates
*/
public function __construct( Remediator $next ) {
$this->next = $next;
diff --git a/includes/Search/Escaper.php b/includes/Search/Escaper.php
index fcf3e78..2d20fd3 100644
--- a/includes/Search/Escaper.php
+++ b/includes/Search/Escaper.php
@@ -100,7 +100,7 @@
* If it isn't then the syntax escaped so it becomes part of the query
text.
*
* @param string $string
- * @return array(string, boolean) (fixedup query string, is this a
fuzzy query?)
+ * @return array(string, boolean) (fixed up query string, is this a
fuzzy query?)
*/
public function fixupWholeQueryString( $string ) {
// Be careful when editing this method because the ordering of
the replacements matters.
diff --git a/includes/Search/RescoreBuilders.php
b/includes/Search/RescoreBuilders.php
index 8aac74c..43c898b 100644
--- a/includes/Search/RescoreBuilders.php
+++ b/includes/Search/RescoreBuilders.php
@@ -289,7 +289,7 @@
}
/**
- * This is usefull to check if the function score is empty
+ * This is useful to check if the function score is empty
* Function score builders may not add any function if some
* criteria are not met. If there's no function we should not
* not build the rescore query.
@@ -403,7 +403,7 @@
}
/**
- * Buils a set of functions with boosted templates
+ * Builds a set of functions with boosted templates
* Uses a weight function with a filter for each template.
* The list of boosted templates is read from SearchContext
*/
@@ -425,7 +425,7 @@
// @todo: verify that this is what we want: in case of a syntax
error
// we disable default boost templates.
if ( $this->boostTemplates === null ) {
- // Fallback to default otherwize
+ // Fallback to default otherwise
$this->boostTemplates =
Util::getDefaultBoostTemplates();
}
}
diff --git a/includes/Search/Result.php b/includes/Search/Result.php
index 3850f06..251a2f6 100644
--- a/includes/Search/Result.php
+++ b/includes/Search/Result.php
@@ -34,7 +34,7 @@
/** @var Title|null */
private $redirectTitle = null;
/** @var string */
- private $redirectSnipppet = '';
+ private $redirectSnippet = '';
/** @var Title|null */
private $sectionTitle = null;
/** @var string */
@@ -102,7 +102,7 @@
// Make sure to find the redirect title before escaping
because escaping breaks it....
$redirects = $result->redirect;
$this->redirectTitle = $this->findRedirectTitle(
$highlights[ 'redirect.title' ][ 0 ], $redirects );
- $this->redirectSnipppet = $this->escapeHighlightedText(
$highlights[ 'redirect.title' ][ 0 ] );
+ $this->redirectSnippet = $this->escapeHighlightedText(
$highlights[ 'redirect.title' ][ 0 ] );
}
$this->textSnippet = $this->escapeHighlightedText(
$this->pickTextSnippet( $highlights ) );
@@ -282,7 +282,7 @@
* @return string
*/
public function getRedirectSnippet() {
- return $this->redirectSnipppet;
+ return $this->redirectSnippet;
}
/**
diff --git a/includes/Search/ResultsType.php b/includes/Search/ResultsType.php
index c12cfef..a59449a 100644
--- a/includes/Search/ResultsType.php
+++ b/includes/Search/ResultsType.php
@@ -28,7 +28,7 @@
/**
* Get the source filtering to be used loading the result.
*
- * @return false|string|array corresonding to Elasticsearch source
filtering syntax
+ * @return false|string|array corresponding to Elasticsearch source
filtering syntax
*/
function getSourceFiltering();
@@ -65,7 +65,7 @@
*/
class TitleResultsType implements ResultsType {
/**
- * @return false|string|array corresonding to Elasticsearch source
filtering syntax
+ * @return false|string|array corresponding to Elasticsearch source
filtering syntax
*/
public function getSourceFiltering() {
return array( 'namespace', 'title' );
@@ -273,7 +273,7 @@
}
/**
- * @return false|string|array corresonding to Elasticsearch source
filtering syntax
+ * @return false|string|array corresponding to Elasticsearch source
filtering syntax
*/
public function getSourceFiltering() {
return array( 'id', 'title', 'namespace', 'redirect.*',
'timestamp', 'text_bytes' );
@@ -480,7 +480,7 @@
*/
class IdResultsType extends TitleResultsType {
/**
- * @return false|string|array corresonding to Elasticsearch source
filtering syntax
+ * @return false|string|array corresponding to Elasticsearch source
filtering syntax
*/
public function getSourceFiltering() {
return false;
@@ -538,7 +538,7 @@
}
/**
- * @return false|string|array corresonding to Elasticsearch source
filtering syntax
+ * @return false|string|array corresponding to Elasticsearch source
filtering syntax
*/
public function getSourceFiltering() {
return array( 'namespace', 'namespace_text', 'title' );
diff --git a/includes/Search/SearchContext.php
b/includes/Search/SearchContext.php
index d2d9b96..10ef484 100644
--- a/includes/Search/SearchContext.php
+++ b/includes/Search/SearchContext.php
@@ -179,7 +179,7 @@
/**
* Return the list of boosted templates specified in the user query
(special syntax)
* null if not used in the query or an empty array if there was a
syntax error.
- * Initiliazed after special syntax extraction.
+ * Initialized after special syntax extraction.
*
* @return array|null of boosted templates, key is the template value
is the weight
*/
diff --git a/includes/Search/SearchTextQueryBuilders.php
b/includes/Search/SearchTextQueryBuilders.php
index 2808d90..0697487 100644
--- a/includes/Search/SearchTextQueryBuilders.php
+++ b/includes/Search/SearchTextQueryBuilders.php
@@ -213,7 +213,7 @@
* This is not necessarily the case for all queries: e.g. 'interesting facts
* about kennedy assassination'. In this case the most important words are
* certainly 'kennedy' and 'assassination'. But it appears that 'interesting'
- * has a lower docFreq than 'kennedy' on english wikipedia, so if the cutoff is
+ * has a lower docFreq than 'kennedy' on english Wikipedia, so if the cutoff is
* not properly set 'kennedy' might be considered as high freq while
* 'interesting' will be a low freq.
*/
@@ -249,7 +249,7 @@
return false;
}
- // the Searcher class relies heavely on the QueryString syntax
and
+ // the Searcher class relies heavily on the QueryString syntax
and
// can generate QueryString syntax (i.e wildcards)
// This builder cannot understand such syntax.
if ( $this->context->isSearchContainedSyntax() ) {
diff --git a/includes/Searcher.php b/includes/Searcher.php
index 74b1fc3..3522b5d 100644
--- a/includes/Searcher.php
+++ b/includes/Searcher.php
@@ -104,7 +104,7 @@
private $suggestSuffixes = array();
- // These fields are filled in by the particule search methods
+ // These fields are filled in by the particular search methods
/**
* @var string term to search.
*/
@@ -207,7 +207,7 @@
User $user = null, $index = false ) {
if ( is_null( $config ) ) {
- // @todo connection has an embeded config ... reuse
that? somehow should
+ // @todo connection has an embedded config ... reuse
that? somehow should
// at least ensure they are the same.
$config = MediaWikiServices::getInstance()
->getConfigFactory()
@@ -664,7 +664,7 @@
if ( $queryStringQueryString !== '' ) {
if ( preg_match( '/(?<!\\\\)[?*+~"!|-]|AND|OR|NOT/',
$queryStringQueryString ) ) {
$this->searchContext->setSearchContainedSyntax(
true );
- // We're unlikey to make good suggestions for
query string with special syntax in them....
+ // We're unlikely to make good suggestions for
query string with special syntax in them....
$showSuggestion = false;
}
$fields = array_merge(
@@ -675,7 +675,7 @@
$this->query = $this->buildSearchTextQuery( $fields,
$nearMatchFields,
$queryStringQueryString, $nearMatchQuery );
- // The highlighter doesn't know about the weightinging
from the all fields so we have to send
+ // The highlighter doesn't know about the weighting
from the all fields so we have to send
// it a query without the all fields. This swaps one
in.
if ( $this->config->getElement(
'CirrusSearchAllFields', 'use' ) ) {
$nonAllFields = array_merge(
@@ -1455,7 +1455,7 @@
/**
* Expand wildcard queries to the all.plain and title.plain fields if
* wgCirrusSearchAllFields[ 'use' ] is set to true. Fallback to all
- * the possible fields otherwize. This prevents applying and compiling
+ * the possible fields otherwise. This prevents applying and compiling
* costly wildcard queries too many times.
* @param string $term
* @return string
@@ -1479,7 +1479,7 @@
/**
* Build fields searched by full text search.
* @param float $weight weight to multiply by all fields
- * @param string $fieldSuffix suffux to add to field names
+ * @param string $fieldSuffix suffix to add to field names
* @param boolean $allFieldAllowed can we use the all field? False for
* collecting phrases for the highlighter.
* @return string[] array of fields to query
@@ -1487,7 +1487,7 @@
public function buildFullTextSearchFields( $weight, $fieldSuffix,
$allFieldAllowed ) {
if ( $this->config->getElement( 'CirrusSearchAllFields', 'use'
) && $allFieldAllowed ) {
if ( $fieldSuffix === '.near_match' ) {
- // The near match fields can't shard a root
field because field fields nead it -
+ // The near match fields can't shard a root
field because field fields need it -
// thus no suffix all.
return array( "all_near_match^${weight}" );
}
diff --git a/includes/Updater.php b/includes/Updater.php
index dcd4253..05b63c3 100644
--- a/includes/Updater.php
+++ b/includes/Updater.php
@@ -102,7 +102,7 @@
* @param Title $title title to trace
* @return array(target, redirects)
* - target is WikiPage|null wikipage if the $title either isn't a
redirect or resolves
- * to an updateable page that hasn't been updated yet. Null if the
page has been
+ * to an updatable page that hasn't been updated yet. Null if the
page has been
* updated, is a special page, or the redirects enter a loop.
* - redirects is an array of WikiPages, one per redirect in the
chain. If title isn't
* a redirect then this will be an empty array
@@ -181,7 +181,7 @@
* Elasticsearch's time format.
* @param null|int $clientSideTimeout timeout in seconds to update
pages or null to not
* change the configured timeout which defaults to 300 seconds.
- * @param int $flags Bitfield containing instructions about how the
document should be built
+ * @param int $flags Bit field containing instructions about how the
document should be built
* and sent to Elasticsearch.
* @return int Number of documents updated of -1 if there was an error
*/
@@ -424,7 +424,7 @@
continue;
}
if ( in_array( $title->getFullText(), $this->updated )
) {
- // We've already updated this page in this
proces so there is no need to update it again.
+ // We've already updated this page in this
process so there is no need to update it again.
continue;
}
// Note that we don't add this page to the list of
updated pages because this update isn't
diff --git a/includes/UserTesting.php b/includes/UserTesting.php
index fb79a19..a54c39e 100644
--- a/includes/UserTesting.php
+++ b/includes/UserTesting.php
@@ -3,14 +3,14 @@
namespace CirrusSearch;
/**
- * Handles decisions arround if the current request is a member of any
+ * Handles decisions around if the current request is a member of any
* test currently being run. This initial implementation is per-request
* but could be extended to keep the same user in the same test/bucket
* over multiple requests.
*
* $wgCirrusSearchUserTesting = array(
* 'someTest' => array(
- * 'sampleRate' => 100, // sample 1 in 100 occurances
+ * 'sampleRate' => 100, // sample 1 in 100 occurrences
* 'buckets' => array(
* 'a' => array(
* // control bucket, retain defaults
diff --git a/includes/Util.php b/includes/Util.php
index d154f30..419fac0 100644
--- a/includes/Util.php
+++ b/includes/Util.php
@@ -135,8 +135,8 @@
* that Cirrus always uses.
* @param string $type same as type parameter on PoolCounter::factory
* @param \User $user the user
- * @param callable $workCallback callback when pool counter is aquired.
Called with
- * no parameters.
+ * @param callable $workCallback callback when pool counter is
acquired. Called with
+ * no parameters.
* @param callable $errorCallback optional callback called on errors.
Called with
* the error string and the key as parameters. If left undefined
defaults
* to a function that returns a fatal status and logs an warning.
@@ -484,8 +484,8 @@
foreach ( $templateMatches as $templateMatch ) {
// templates field is populated with
Title::getPrefixedText
// which will replace _ to ' '. We should do
the same here.
- $tmpl = strtr( $templateMatch[ 1 ], '_', ' ' );
- $boostTemplates[ $tmpl ] = floatval(
$templateMatch[ 2 ] ) / 100;
+ $template = strtr( $templateMatch[ 1 ], '_', '
' );
+ $boostTemplates[ $template ] = floatval(
$templateMatch[ 2 ] ) / 100;
}
}
return $boostTemplates;
diff --git a/maintenance/checkIndexes.php b/maintenance/checkIndexes.php
index 01817e6..59d060c 100644
--- a/maintenance/checkIndexes.php
+++ b/maintenance/checkIndexes.php
@@ -34,7 +34,7 @@
/**
* @var array[] Nested array of arrays containing error strings.
Individual
* errors are nested based on the keys in self::$path at the time the
error
- * occured.
+ * occurred.
*/
private $errors = array();
/**
@@ -58,7 +58,7 @@
public function execute() {
if ( $this->hasOption( 'nagios' ) ) {
- // Force silent running mode so we can match Nagio's
expected output.
+ // Force silent running mode so we can match Nagios
expected output.
$this->mQuiet = true;
}
$this->ensureClusterStateFetched();
@@ -99,13 +99,13 @@
*/
private function checkIndex( $indexName, $expectedShardCount ) {
$this->path = array();
- $metdata = $this->getIndexMetadata( $indexName );
+ $metadata = $this->getIndexMetadata( $indexName );
$this->in( $indexName );
- if ( $metdata === null ) {
+ if ( $metadata === null ) {
$this->err( "does not exist" );
return;
}
- $this->check( 'state', 'open', $metdata[ 'state' ] );
+ $this->check( 'state', 'open', $metadata[ 'state' ] );
// TODO check aliases
$routingTable = $this->getIndexRoutingTable( $indexName );
diff --git a/maintenance/cirrusNeedsToBeBuilt.php
b/maintenance/cirrusNeedsToBeBuilt.php
index 5bbc586..56f48e9 100644
--- a/maintenance/cirrusNeedsToBeBuilt.php
+++ b/maintenance/cirrusNeedsToBeBuilt.php
@@ -35,7 +35,7 @@
class CirrusIsSetup extends Maintenance {
public function __construct() {
parent::__construct();
- $this->addDescription( "Update the configuration or contents of
all search indecies. Always operates on a single cluster." );
+ $this->addDescription( "Update the configuration or contents of
all search indices. Always operates on a single cluster." );
}
public function execute() {
diff --git a/maintenance/dumpIndex.php b/maintenance/dumpIndex.php
index 9099d4e..10d7b5b 100644
--- a/maintenance/dumpIndex.php
+++ b/maintenance/dumpIndex.php
@@ -78,7 +78,7 @@
"curl -s -XPOST localhost:9200/{index}/_bulk
--data-binary @dump-file\n" .
"Note that you need to specify the index in the URL
because the bulk commands do not " .
"contain the index name. Beware that the bulk import is
not meant to import very large " .
- "files, sweetspot seems to be between 2000 and 5000
documents (see examples below)." .
+ "files, sweet spot seems to be between 2000 and 5000
documents (see examples below)." .
"\nThis always operates on a single cluster." .
"\n\nExamples :\n" .
" - Dump a general index :" .
@@ -87,7 +87,7 @@
"\n\tdumpIndex --indexType content | split -d -a 9 -l
100000 --filter 'gzip -c > \$FILE.txt.gz' - \"\" \n" .
"\nYou can import the data with the following commands
:\n" .
" - Import chunks of 2000 documents :" .
- "\n\tcat dump | split -l 4000 --filter 'curl -s
http://elastic:9200/{indexName}/_bulk --data-binarya @- > /dev/null'\n" .
+ "\n\tcat dump | split -l 4000 --filter 'curl -s
http://elastic:9200/{indexName}/_bulk --data-binary @- > /dev/null'\n" .
" - Import 3 chunks of 2000 documents in parallel :" .
"\n\tcat dump | parallel --pipe -L 2 -N 2000 -j3 'curl
-s http://elastic:9200/{indexName}/_bulk --data-binary @- > /dev/null'");
$this->addOption( 'indexType', 'Index to dump. Either content
or general.', true, true );
diff --git a/maintenance/forceSearchIndex.php b/maintenance/forceSearchIndex.php
index 8b27ff7..eb11f30 100644
--- a/maintenance/forceSearchIndex.php
+++ b/maintenance/forceSearchIndex.php
@@ -98,7 +98,7 @@
// Set the timeout for maintenance actions
$this->getConnection()->setTimeout(
$wgCirrusSearchMaintenanceTimeout );
- // Make sure we've actually got indicies to populate
+ // Make sure we've actually got indices to populate
if ( !$this->simpleCheckIndexes() ) {
$this->error( "$wiki index(es) do not exist. Did you
forget to run updateSearchIndexConfig?", 1 );
}
diff --git a/maintenance/updateSearchIndexConfig.php
b/maintenance/updateSearchIndexConfig.php
index 9880bff..207d63b 100644
--- a/maintenance/updateSearchIndexConfig.php
+++ b/maintenance/updateSearchIndexConfig.php
@@ -34,7 +34,7 @@
class UpdateSearchIndexConfig extends Maintenance {
public function __construct() {
parent::__construct();
- $this->addDescription( "Update the configuration or contents of
all search indecies. This always operates on a single cluster." );
+ $this->addDescription( "Update the configuration or contents of
all search indices. This always operates on a single cluster." );
// Directly require this script so we can include its
parameters as maintenance scripts can't use the autoloader
// in __construct. Lame.
require_once __DIR__ . '/updateOneSearchIndexConfig.php';
diff --git a/maintenance/updateSuggesterIndex.php
b/maintenance/updateSuggesterIndex.php
index e43f2ab..977bff6 100644
--- a/maintenance/updateSuggesterIndex.php
+++ b/maintenance/updateSuggesterIndex.php
@@ -157,7 +157,7 @@
$this->addOption( 'optimize', 'Optimize the index to 1 segment.
Defaults to false.', false, false );
$this->addOption( 'with-geo', 'Build geo contextualized
suggestions. Defaults to false.', false, false );
$this->addOption( 'scoringMethod', 'The scoring method to use
when computing suggestion weights. ' .
- 'Detauls to $wgCirrusSearchCompletionDefaultScore or
quality if unset.', false, true );
+ 'Defaults to $wgCirrusSearchCompletionDefaultScore or
quality if unset.', false, true );
$this->addOption( 'masterTimeout', 'The amount of time to wait
for the master to respond to mapping ' .
'updates before failing. Defaults to
$wgCirrusSearchMasterTimeout.', false, true );
$this->addOption( 'replicationTimeout', 'The amount of time
(seconds) to wait for the replica shards to initialize. ' .
@@ -379,7 +379,7 @@
*
* Drawbacks: the FST will be read from disk twice in a short
* amount of time.
- * This is a tradeoff between cluster operation and disk operation.
+ * This is a trade off between cluster operation and disk operation.
* Recreating the index may require less disk operations but causes
* the cluster to rebalance.
* This is certainly the best strategy for small indices (less than
100k docs)
@@ -508,7 +508,7 @@
if ( $this->builder == null ) {
// NOTE: the builder stores a batchId value to flag
// documents indexed by this builder. Make sure to
- // reuse the same instance when building docs otherwize
+ // reuse the same instance when building docs otherwise
// the batchId might be regenerated and can cause data
// loss when recycling the index.
$this->builder = new SuggestBuilder(
$this->scoreMethod, $this->withGeo );
diff --git a/profiles/PhraseSuggesterProfiles.php
b/profiles/PhraseSuggesterProfiles.php
index 5f8cb53..539ed60 100644
--- a/profiles/PhraseSuggesterProfiles.php
+++ b/profiles/PhraseSuggesterProfiles.php
@@ -72,7 +72,7 @@
// The prefix length used by the phrase suggester The number of
// minimal prefix characters that must match in order be a
// candidate suggestions. Defaults to 1. Increasing this number
- // improves spellcheck performance. Usually misspellings don’t
+ // improves spell check performance. Usually misspellings don’t
// occur in the beginning of terms.
'prefix_length' => 2,
diff --git a/profiles/RescoreProfiles.php b/profiles/RescoreProfiles.php
index d65922c..f38da36 100644
--- a/profiles/RescoreProfiles.php
+++ b/profiles/RescoreProfiles.php
@@ -49,7 +49,7 @@
// the rescore window size
'window' => 8192,
- // The window size can be overiden by a config
a value if set
+ // The window size can be overridden by a
config a value if set
'window_size_override' =>
'CirrusSearchFunctionRescoreWindowSize',
// relative importance of the original query
--
To view, visit https://gerrit.wikimedia.org/r/284345
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id5ba17edd17fbd4de926daa47312c1414a611287
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: EBernhardson <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits