aboutsummaryrefslogtreecommitdiffstats
path: root/includes/api/SearchApi.php
Commit message (Collapse)AuthorAgeFilesLines
* Remove documentation that literally repeats the codeThiemo Kreuz2020-10-271-1/+1
| | | | | | | | | | | | | | | For example, documenting the method getUser() with "get the User object" does not add any information that's not already there. But I have to read the text first to understand that it doesn't document anything that's not already obvious from the code. Some of this is from a time when we had a PHPCS sniff that was complaining when a line like `@param User $user` doesn't end with some descriptive text. Some users started adding text like `@param User $user The User` back then. Let's please remove this. Change-Id: I0ea8d051bc732466c73940de9259f87ffb86ce7a
* Unsuppress more phan issues (part 5)Daimona Eaytoy2019-09-011-0/+2
| | | | | | Bug: T231636 Depends-On: I6e5fba7bd273219b1206559420b5bdb78734aa84 Change-Id: I50377746f01749b058c39fd8229f9d566224cc43
* Add missing newline between <?php and namespace/use sectionThiemo Kreuz2019-06-031-0/+1
| | | | | | The rest of the codebase is using this code formatting standard. Change-Id: I4d2ba61757a7e28d40096d9dc5915005c340d4f2
* Use PHP 7 '??' operator instead of '?:' (round 2)Bartosz Dziewoński2018-09-031-1/+1
| | | | | | A few issues have snuck in since I33b421c8cb11cdd4ce896488c9ff5313f03a38cf. Change-Id: Ib75470a7a3c19e2d48f498b396eee6ed733690e4
* Push pagination decision for search into SearchEngineErik Bernhardson2018-06-111-12/+3
| | | | | | | | | Various code using the search engine shouldn't need to implement it's own methods, such as over-fetching, to determine if there are more results available. This should be knowledge internal to search that is exposed by a boolean. Change-Id: Ica094428700637dfdedb723b03f6aeadfe12b9f4
* Use PHP 7 '??' operator instead of '?:' with 'isset()' where convenientBartosz Dziewoński2018-05-301-1/+1
| | | | | | | | | | | | | | Find: /isset\(\s*([^()]+?)\s*\)\s*\?\s*\1\s*:\s*/ Replace with: '\1 ?? ' (Everywhere except includes/PHPVersionCheck.php) (Then, manually fix some line length and indentation issues) Then manually reviewed the replacements for cases where confusing operator precedence would result in incorrect results (fixing those in I478db046a1cc162c6767003ce45c9b56270f3372). Change-Id: I33b421c8cb11cdd4ce896488c9ff5313f03a38cf
* update mediawiki-codesniffer to 0.11.0 and fix issuesWMDE-Fisch2017-08-111-1/+1
| | | | | | | | - mostly auto fixes - some too long lines fixed - ignore amp space in one case passing by reference Change-Id: I6472f83bc3cbf4bd629d83050cc3319b19ec465c
* Use correct variable name in @param documentationUmherirrender2017-08-111-1/+1
| | | | | | | | | | | For some varargs a variable name is added with suffix ,... as seen for many other varargs Some @param are swapped, because there are in the wrong order Enable Sniff MediaWiki.Commenting.FunctionComment.ParamNameNoMatch Change-Id: I60fec6025bce824d5c67563ab7b65ad6cd628ad8
* Pass User to SearchEngine::getProfilesdcausse2016-09-201-1/+7
| | | | | | | Useful for search engines that allow users to customize search profiles. Depends-On: Icd577c8ebc6e162befe30bde4fe276e633d2e434 Change-Id: I471cd090730d2a25cb70d622ec3bebbe9583118c
* Push common search api parameters into SearchApi classErik Bernhardson2016-07-261-22/+97
| | | | | | | | | | We have a number of parameters that are pretty much the same between these different search api's. Lets make them actually the same by sharing the definitions, and then letting individual classes tweak them as needed by removing the offset, or adjusting the max limits as necessary. Change-Id: I6f987db8ecb63dc943b4d2518bfe3703c677448e
* Don't lose namespace when searching via apiErik Bernhardson2016-06-021-1/+1
| | | | | | | | A recent patch, I66be724d, introduced a regression that no longer applied user selected namespaces to the search engine. Fix that up so we give the correct responses to api rqeuests. Change-Id: I8e5e180cb143ae3cddeb12f51bc7aae75b20fe58
* Expose SearchEngine specific profilesdcausse2016-05-301-0/+116
This patch introduces a way for SearchEngine implementations to expose specific search profiles useful to fine-tune the various behaviors related to search. A SearchEngine can expose a list of profiles by overriding SearchEngine::getProfiles( $profileType ), profileType stands for the type of profile being customized. Two types are added in this patch: - completion: exposed by ApiQueryPrefixSearch and ApiOpenSearch to control the behavior of the algorithm behind "search as you type" suggestions. - fulltext query independent profiles: exposed by ApiQuerySearch to customize query indpendent ranking profiles (e.g. boost by templates/incoming links/popularity/...) This patch allows api consumers that might have been confused by fuzzy suggestions to switch to stricter profiles and to officialize the behavior behind the hidden param cirrusUseCompletionSuggester. Or to control the fulltext ranking behaviors like cirrusBoostLinks=(yes|no). The list of profiles can be discovered by using ApiSandbox/ApiHelp and is totally controlled by search engine implementations. Bug: T132477 Change-Id: I66be724d8975976c98c91badbf421f237e014f89