Chad has uploaded a new change for review.
https://gerrit.wikimedia.org/r/183889
Change subject: Remove remaining wfProfile* calls
......................................................................
Remove remaining wfProfile* calls
Change-Id: Ia7a4230b43129a30e9613170010776cb7eb08546
---
M includes/Maintenance/Reindexer.php
M includes/Searcher.php
2 files changed, 0 insertions(+), 24 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CirrusSearch
refs/changes/89/183889/1
diff --git a/includes/Maintenance/Reindexer.php
b/includes/Maintenance/Reindexer.php
index 7b5bb48..ccf01fb 100644
--- a/includes/Maintenance/Reindexer.php
+++ b/includes/Maintenance/Reindexer.php
@@ -277,7 +277,6 @@
$completed = 0;
$self = $this;
while ( true ) {
- wfProfileIn( __METHOD__ . '::receiveDocs' );
$result = $this->withRetry( $retryAttempts,
$messagePrefix, 'fetching documents to reindex',
function() use ( $self, $result ) {
return $self->index->search(
array(), array(
@@ -285,12 +284,10 @@
'scroll' => '1h'
) );
} );
- wfProfileOut( __METHOD__ . '::receiveDocs' );
if ( !$result->count() ) {
$this->outputIndented( $messagePrefix .
"All done\n" );
break;
}
- wfProfileIn( __METHOD__ . '::packageDocs' );
$documents = array();
while ( $result->current() ) {
// Build the new document to just
contain keys which have a mapping in the new properties. To clean
@@ -305,7 +302,6 @@
$documents[] = $document;
$result->next();
}
- wfProfileOut( __METHOD__ . '::packageDocs' );
$this->withRetry( $retryAttempts,
$messagePrefix, 'retrying as singles',
function() use ( $self, $messagePrefix,
$documents ) {
$self->sendDocuments(
$messagePrefix, $documents );
diff --git a/includes/Searcher.php b/includes/Searcher.php
index f54b211..e7e3acc 100644
--- a/includes/Searcher.php
+++ b/includes/Searcher.php
@@ -342,7 +342,6 @@
$this->boostLinks = $wgCirrusSearchBoostLinks;
$searchType = 'full_text';
// Handle title prefix notation
- wfProfileIn( __METHOD__ . '-prefix-filter' );
$prefixPos = strpos( $this->term, 'prefix:' );
if ( $prefixPos !== false ) {
$value = substr( $this->term, 7 + $prefixPos );
@@ -364,9 +363,7 @@
}
}
}
- wfProfileOut( __METHOD__ . '-prefix-filter' );
- wfProfileIn( __METHOD__ . '-prefer-recent' );
$preferRecentDecayPortion =
$wgCirrusSearchPreferRecentDefaultDecayPortion;
$preferRecentHalfLife =
$wgCirrusSearchPreferRecentDefaultHalfLife;
// Matches "prefer-recent:" and then an optional floating point
number <= 1 but >= 0 (decay
@@ -390,9 +387,7 @@
);
$this->preferRecentDecayPortion = $preferRecentDecayPortion;
$this->preferRecentHalfLife = $preferRecentHalfLife;
- wfProfileOut( __METHOD__ . '-prefer-recent' );
- wfProfileIn( __METHOD__ . '-local' );
$this->extractSpecialSyntaxFromTerm(
'/^\s*local:/',
function ( $matches ) use ( $searcher ) {
@@ -400,10 +395,8 @@
return '';
}
);
- wfProfileOut( __METHOD__ . '-local' );
// Handle other filters
- wfProfileIn( __METHOD__ . '-other-filters' );
$filters = $this->filters;
$notFilters = $this->notFilters;
$boostTemplates = self::getDefaultBoostTemplates();
@@ -576,11 +569,9 @@
$this->searchContainedSyntax = $searchContainedSyntax;
$this->fuzzyQuery = $fuzzyQuery;
$this->highlightSource = $highlightSource;
- wfProfileOut( __METHOD__ . '-other-filters' );
$this->term = $this->escaper->escapeQuotes( $this->term );
- wfProfileIn( __METHOD__ . '-find-phrase-queries' );
// Match quoted phrases including those containing escaped
quotes
// Those phrases can optionally be followed by ~ then a number
(this is the phrase slop)
// That can optionally be followed by a ~ (this matches stemmed
words in phrases)
@@ -604,8 +595,6 @@
}
return array( 'escaped' => $negate . $main );
} );
- wfProfileOut( __METHOD__ . '-find-phrase-queries' );
- wfProfileIn( __METHOD__ . '-switch-prefix-to-plain' );
// Find prefix matches and force them to only match against the
plain analyzed fields. This
// prevents prefix matches from getting confused by stemming.
Users really don't expect stemming
// in prefix queries.
@@ -617,9 +606,7 @@
'nonAll' =>
$searcher->switchSearchToExact( $term, false ),
);
} );
- wfProfileOut( __METHOD__ . '-switch-prefix-to-plain' );
- wfProfileIn( __METHOD__ . '-escape' );
$escapedQuery = array();
$nonAllQuery = array();
$nearMatchQuery = array();
@@ -642,7 +629,6 @@
}
wfLogWarning( 'Unknown query part: ' . serialize(
$queryPart ) );
}
- wfProfileOut( __METHOD__ . '-escape' );
// Actual text query
list( $queryStringQueryString, $this->fuzzyQuery ) =
@@ -655,7 +641,6 @@
// We're unlikey to make good suggestions for
query string with special syntax in them....
$showSuggestion = false;
}
- wfProfileIn( __METHOD__ . '-build-query' );
$fields = array_merge(
$this->buildFullTextSearchFields( 1, '.plain',
true ),
$this->buildFullTextSearchFields(
$wgCirrusSearchStemmedWeight, '', true ) );
@@ -710,12 +695,10 @@
'suggest' => $this->buildSuggestConfig(
'suggest' ),
);
}
- wfProfileOut( __METHOD__ . '-build-query' );
$result = $this->search( $searchType, $originalTerm );
if ( !$result->isOK() && $this->isParseError( $result )
) {
- wfProfileIn( __METHOD__ . '-degraded-query' );
// Elasticsearch has reported a parse error and
we've already logged it when we built the status
// so at this point all we can do is retry the
query as a simple query string query.
$this->query = new \Elastica\Query\Simple(
array( 'simple_query_string' => array(
@@ -728,7 +711,6 @@
// If that doesn't work we're out of luck but
it should. There no guarantee it'll work properly
// with the syntax we've built above but it'll
do _something_ and we'll still work on fixing all
// the parse errors that come in.
- wfProfileOut( __METHOD__ . '-degraded-query' );
}
} else {
$result = $this->search( $searchType, $originalTerm );
@@ -1065,7 +1047,6 @@
// Perform the search
$searcher = $this;
- wfProfileIn( __METHOD__ . '-execute' );
$user = $this->user;
$result = Util::doPoolCounterWork(
$poolCounterType,
@@ -1092,7 +1073,6 @@
}
return Status::newFatal(
'cirrussearch-backend-error' );
});
- wfProfileOut( __METHOD__ . '-execute' );
if ( $result->isOK() ) {
$responseData =
$result->getValue()->getResponse()->getData();
$result->setResult( true,
$this->resultsType->transformElasticsearchResult( $this->suggestPrefixes,
--
To view, visit https://gerrit.wikimedia.org/r/183889
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia7a4230b43129a30e9613170010776cb7eb08546
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: Chad <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits