Code Duplication    Length = 7-8 lines in 2 locations

maintenance/rebuildtextindex.php 2 locations

@@ 131-138 (lines=8) @@
128
	/**
129
	 * (MySQL only) Drops fulltext index before populating the table.
130
	 */
131
	private function dropMysqlTextIndex() {
132
		$searchindex = $this->db->tableName( 'searchindex' );
133
		if ( $this->db->indexExists( 'searchindex', 'si_title', __METHOD__ ) ) {
134
			$this->output( "Dropping index...\n" );
135
			$sql = "ALTER TABLE $searchindex DROP INDEX si_title, DROP INDEX si_text";
136
			$this->db->query( $sql, __METHOD__ );
137
		}
138
	}
139
140
	/**
141
	 * (MySQL only) Adds back fulltext index after populating the table.
@@ 143-149 (lines=7) @@
140
	/**
141
	 * (MySQL only) Adds back fulltext index after populating the table.
142
	 */
143
	private function createMysqlTextIndex() {
144
		$searchindex = $this->db->tableName( 'searchindex' );
145
		$this->output( "\nRebuild the index...\n" );
146
		$sql = "ALTER TABLE $searchindex ADD FULLTEXT si_title (si_title), " .
147
			"ADD FULLTEXT si_text (si_text)";
148
		$this->db->query( $sql, __METHOD__ );
149
	}
150
151
	/**
152
	 * Deletes everything from search index.