# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# http://www.gnu.org/copyleft/gpl.html
+/**
+ * @file
+ * @ingroup Search
+ */
+
/**
* Search engine hook base class for Oracle (ConText).
- * @addtogroup Search
+ * @ingroup Search
*/
class SearchOracle extends SearchEngine {
function __construct($db) {
* @private
*/
function queryNamespaces() {
- $namespaces = implode(',', $this->namespaces);
- if ($namespaces == '') {
+ if( is_null($this->namespaces) )
+ return '';
+ if ( !count( $this->namespaces ) ) {
$namespaces = '0';
+ } else {
+ $namespaces = $this->db->makeList( $this->namespaces );
}
return 'AND page_namespace IN (' . $namespaces . ')';
}
'WHERE page_id=si_page AND ' . $match;
}
- /** @todo document */
+ /**
+ * Parse a user input search string, and return an SQL fragment to be used
+ * as part of a WHERE clause
+ */
function parseQuery($filteredText, $fulltext) {
global $wgContLang;
$lc = SearchEngine::legalSearchChars();
}
}
- $searchon = $this->db->strencode(join(',', $q));
+ $searchon = $this->db->addQuotes(join(',', $q));
$field = $this->getIndexField($fulltext);
- return " CONTAINS($field, '$searchon', 1) > 0 ";
+ return " CONTAINS($field, $searchon, 1) > 0 ";
}
/**
}
/**
- * @addtogroup Search
+ * @ingroup Search
*/
class OracleSearchResultSet extends SearchResultSet {
function __construct($resultSet, $terms) {
return new SearchResult($row);
}
}
-
-