aboutsummaryrefslogtreecommitdiffstats
path: root/includes/search/SearchDatabase.php
Commit message (Collapse)AuthorAgeFilesLines
* Remove trivial 1-line PHPDocs that just repeat the codethiemowmde2025-01-161-3/+0
| | | | | | | | | | | | | I assume these are all either auto-generated by an IDE or the language-level type declarations have been added later. In any case the comments don't add any new information to what the code already says. This is just extra clutter that makes the code harder to read, I would argue. There are many, many more comments like this. In this patch I intentionally focus on the most trivial 1-line comments. Change-Id: Ia294bf4ce0d8a77036842fe25884bc175c2b0e7d
* db: Better Error messaging when Title search query not compatible with db EngineAtieno2024-02-211-1/+16
| | | | | Bug: T355096 Change-Id: I7aba39fd3c19522b576ad38d69479e109e645538
* Reorg: Move Status to MediaWiki\Status\Amir Sarabadani2023-08-251-0/+1
| | | | | | | | | | This class is used heavily basically everywhere, moving it to Utils wouldn't make much sense. Also with this change, we can move StatusValue to MediaWiki\Status as well. Bug: T321882 Depends-On: I5f89ecf27ce1471a74f31c6018806461781213c3 Change-Id: I04c1dcf5129df437589149f0f3e284974d7c98fa
* search: Make DB-backed search engines use ICP instead of LB/LBFAmir Sarabadani2023-07-131-12/+5
| | | | | Bug: T330641 Change-Id: I5eff8865d77bbcca78b891a440fdde9f312a013c
* rdbms: Deprecate getLazyConnectionRefAmir Sarabadani2022-03-031-1/+1
| | | | | Bug: T255493 Change-Id: Ie352142c7aa120f2f8985ddcf755a1f4583a5410
* Replace "@stable for subclassing" with "@stable to extend"daniel2020-07-131-1/+1
| | | | | | | | | | | For compliance with the new version of the table interface policy (T255803). This patch was created by an automated search & replace operation on the includes/ directory. Bug: T257789 Change-Id: Ie32c1b11b3d16ddfc0c83a757327d449ff80b2e4
* Mark search base classes as stable for subclassingdaniel2020-07-081-0/+1
| | | | | Bug: T247862 Change-Id: Id899e705619a77a9a2e39b4ace13c4b0445d0a4a
* Merge "Document SearchDatabase::doSearchTextInDB to return null"jenkins-bot2019-08-011-2/+2
|\
| * Document SearchDatabase::doSearchTextInDB to return nullUmherirrender2019-07-311-2/+2
| | | | | | | | | | | | | | | | | | The function calling this abstract function allows to return null, so it should be okay to return null here The null for empty result in SearchOracle Change-Id: I66a8fb3a4190bf5506f358a47f6f4833b1715c7f
* | Add ISearchResultSetDavid Causse2019-07-221-2/+2
|/ | | | | Bug: T228626 Change-Id: I3306bf6107c97dd58adf578fd965bd11a422627d
* Deprecate SearchResult::termMatches()David Causse2019-06-271-0/+5
| | | | | | | | | | | | | | | | | | | | And start indicating that hooks relying on this data might become unreliable as this data is only populated by SearchDatabase search engines. This information was only populated by SearchDatabase implementations and due to bad initial design of SearchResult[Set] (now fixed) it forced users of these classes to carry this information for the sole purpose of highlighting. Because SearchEngine can now own their SearchResult[Set] implementations nothing that is engine specific should be exposed outside of these specific implementations. If there are some logic that still requires access to such list of terms they should be made engine specific by guarding their code against instanceof SqlSearchResult. Change-Id: I38b82c5e4c35309ee447edc3ded60ca6a18b247a Depends-On: I53fe37c65c7940f696c1e184125e01e592a976e4
* search: refactor DatabaseSearch to take a load balancer instanceAaron Schulz2019-06-261-6/+9
| | | | | | | | | | | Also make the update() methods of the subclasses use DB_MASTER as they should. This avoids read-only errors. In addition, avoid passing a dummy argument of null in some cases within SearchEngineFactory::create(). Fix some dynamic calls to static methods too. Change-Id: Id94f34994b0f9c18e23ef30cb2fe895e6dedd09c
* Simplify by using ?: operatorFomafix2019-04-151-5/+1
| | | | Change-Id: I2851cc51c9e05dd0599733be5af39e19f12b52e2
* doc: Modernise parameter names and documentation for 'replica' DBsJames D. Forrester2018-10-311-1/+1
| | | | | | | | | Non-breaking change. Remaining uses are public interfaces (a constant, two globals, a config sub-parameter, SQL queries, storage function names), one i18n message key, and a whole lot of maintenance scripts with calls to the deprecated function wfWaitForSlaves(). Change-Id: I6ee5ca92ccf6a80c08f53d9efe38ebb4b05064d7
* Deprecate SearchEngine::replacePrefixesDavid Causse2018-07-171-1/+48
| | | | | | | | This should be handled internally by SearchEngine implementations. Bug: T198860 Change-Id: Ifbfd0fcb81fcacf5228bd2ffcac7b80fca872b2a Depends-On: I7d4ff9498fa1f4ea66835c634b8931f4c29993fb
* Fix PhanTypeMismatchDeclaredParamUmherirrender2018-07-071-1/+1
| | | | | | Auto fix MediaWiki.Commenting.FunctionComment.DefaultNullTypeParam sniff Change-Id: I865323fd0295aabd06f3e3c75e0e5043fb31069e
* Remove auto-generated "Constructor" documentation on constructorsThiemo Mättig2017-07-211-1/+0
| | | | | | | | | | | Having such comments is worse than not having them. They add zero information. But you must read the text to understand there is nothing you don't already know from the class and the method name. This is similar to I994d11e. Even more trivial, because this here is about comments that don't say anything but "constructor". Change-Id: I474dcdb5997bea3aafd11c0760ee072dfaff124c
* Fix phrase searchDavid Causse2017-07-031-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Partially revert I61dc536 that broke phrase search support. Fix phrase search by making explicit that there are two kind of legalSearchChars() usecases : - the chars allowed to be part of the search query (including special syntax chars such as " and *). Used by SearchDatabase::filter() to cleanup the whole query string (the default). - the chars allowed to be part of a search term (excluding special syntax chars) Used by search engine implementaions when parsing with a regex. For future reference: Originally this distinction was made "explicit" by calling directly SearchEngine::legalSearchChars() during the parsing stage. This was broken by Iaabc10c by enabling inheritance. This patch adds a new optional param to legalSearchChars to make this more explicit. Also remove the function I introduced in I61dc536 (I wrongly assumed that the disctinction made between legalSearchChars usecases was due to a difference in behavior between indexing and searching). Added more tests to prevent this from happening in the future. Bug: T167798 Change-Id: Ibdc796bb2881a2ed8194099d8c9f491980010f0f
* Move IDatabase/IMaintainableDatabase to Rdbms namespaceAaron Schulz2017-03-281-0/+2
| | | | Change-Id: If7e8a8ff574661fd827de8bcec11d2c39a687300
* Rename DB_SLAVE constant to DB_REPLICAAaron Schulz2016-09-051-1/+1
| | | | | | | | | This is more consistent with LoadBalancer, modern, and inclusive of master/master mysql, NDB cluster, and MariaDB galera cluster. The old constant is an alias now. Change-Id: I0b37299ecb439cc446ffbe8c341365d1eef45849
* Update various @params from DatabaseBase to IDatabaseAaron Schulz2015-10-051-3/+3
| | | Change-Id: I98e44cdffb0fc0d729f69f702799139afb988c20
* Database search fixes:Chad Horohoe2014-06-201-0/+11
| | | | | | | | | - Move filter() function and make it protected, nothing uses it outside database-backed searching - Use per-backend legal search characters rather than assuming the static implementation is right Change-Id: Ic2b830b56137b2dfe68b9b9c3de012151e716952
* Begin abstracting more of the database-specific search backend outChad Horohoe2014-01-211-0/+46
There's a lot in the base search implementations that is specific to the database backed search. This starts moving some of that out into a shared base class for those. For starters, let's not grab a connection to the slave DB for every single search for backends unless they need it. Change-Id: Ib66696841eea901e04b21dd309784af889a45ab1