EBernhardson has uploaded a new change for review.
https://gerrit.wikimedia.org/r/284261
Change subject: Drop unused method indexToIndexTypes
......................................................................
Drop unused method indexToIndexTypes
This looks to have been removed in 5ce886eb8c21823d01e68d8ebde5e136c0e55607
Change-Id: Ied47e319d3af547656735652a643bed1b6d22798
---
M includes/Connection.php
1 file changed, 0 insertions(+), 38 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CirrusSearch
refs/changes/61/284261/1
diff --git a/includes/Connection.php b/includes/Connection.php
index e620f2b..8f7ced4 100644
--- a/includes/Connection.php
+++ b/includes/Connection.php
@@ -242,44 +242,6 @@
}
/**
- * Given a list of Index objects, return the 'type' portion of the name
- * of that index. This matches the types as returned from
- * self::getAllIndexTypes().
- *
- * @param \Elastica\Index[] $indexes
- * @return string[]
- */
- public function indexToIndexTypes( array $indexes ) {
- $allowed = $this->getAllIndexTypes();
- return array_map( function( $type ) use ( $allowed ) {
- $fullName = $type->getIndex()->getName();
- $parts = explode( '_', $fullName );
- // In 99% of cases it should just be the second
- // piece of a 2 or 3 part name.
- if ( isset( $parts[1] ) && in_array( $parts[1],
$allowed ) ) {
- return $parts[1];
- }
- // the wikiId should be the first part of the name and
- // not part of our result, strip it
- if ( $parts[0] === wfWikiID() ) {
- $parts = array_slice( $parts, 1 );
- }
- // there might be a suffix at the end, try stripping it
- $maybe = implode( '_', array_slice( $parts, 0, -1 ) );
- if ( in_array( $maybe, $allowed ) ) {
- return $maybe;
- }
- // maybe there wasn't a suffix at the end, try the
whole thing
- $maybe = implode( '_', $parts );
- if ( in_array( $maybe, $allowed ) ) {
- return $maybe;
- }
- // probably not right, but at least we tried
- return $fullName;
- }, $indexes );
- }
-
- /**
* Get the index suffix for a given namespace
* @param int $namespace A namespace id
* @return string
--
To view, visit https://gerrit.wikimedia.org/r/284261
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ied47e319d3af547656735652a643bed1b6d22798
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