Code Duplication    Length = 8-9 lines in 4 locations

includes/search/SearchMssql.php 1 location

@@ 122-130 (lines=9) @@
119
	 * @return string
120
	 * @private
121
	 */
122
	function queryMain( $filteredTerm, $fulltext ) {
123
		$match = $this->parseQuery( $filteredTerm, $fulltext );
124
		$page = $this->db->tableName( 'page' );
125
		$searchindex = $this->db->tableName( 'searchindex' );
126
127
		return 'SELECT page_id, page_namespace, page_title, ftindex.[RANK]' .
128
			"FROM $page,FREETEXTTABLE($searchindex , $match, LANGUAGE 'English') as ftindex " .
129
			'WHERE page_id=ftindex.[KEY] ';
130
	}
131
132
	/** @todo document
133
	 * @param string $filteredText

includes/search/SearchOracle.php 1 location

@@ 159-166 (lines=8) @@
156
	 * @param bool $fulltext
157
	 * @return string
158
	 */
159
	function queryMain( $filteredTerm, $fulltext ) {
160
		$match = $this->parseQuery( $filteredTerm, $fulltext );
161
		$page = $this->db->tableName( 'page' );
162
		$searchindex = $this->db->tableName( 'searchindex' );
163
		return 'SELECT page_id, page_namespace, page_title ' .
164
			"FROM $page,$searchindex " .
165
			'WHERE page_id=si_page AND ' . $match;
166
	}
167
168
	/**
169
	 * Parse a user input search string, and return an SQL fragment to be used

includes/search/SearchSqlite.php 2 locations

@@ 244-251 (lines=8) @@
241
	 * @param bool $fulltext
242
	 * @return string
243
	 */
244
	function queryMain( $filteredTerm, $fulltext ) {
245
		$match = $this->parseQuery( $filteredTerm, $fulltext );
246
		$page = $this->db->tableName( 'page' );
247
		$searchindex = $this->db->tableName( 'searchindex' );
248
		return "SELECT $searchindex.rowid, page_namespace, page_title " .
249
			"FROM $page,$searchindex " .
250
			"WHERE page_id=$searchindex.rowid AND $match";
251
	}
252
253
	function getCountQuery( $filteredTerm, $fulltext ) {
254
		$match = $this->parseQuery( $filteredTerm, $fulltext );
@@ 253-261 (lines=9) @@
250
			"WHERE page_id=$searchindex.rowid AND $match";
251
	}
252
253
	function getCountQuery( $filteredTerm, $fulltext ) {
254
		$match = $this->parseQuery( $filteredTerm, $fulltext );
255
		$page = $this->db->tableName( 'page' );
256
		$searchindex = $this->db->tableName( 'searchindex' );
257
		return "SELECT COUNT(*) AS c " .
258
			"FROM $page,$searchindex " .
259
			"WHERE page_id=$searchindex.rowid AND $match " .
260
			$this->queryNamespaces();
261
	}
262
263
	/**
264
	 * Create or update the search index record for the given page.