Commit graph

11 commits

Author SHA1 Message Date
Nikki Nikkhoui
f16c46dcb0 api-testing: Remove 'matched_title' check
Sqlite and MySQL are returning results in different
orders for the REST Search handler, which affects how it handles
de-duplicating results with redirects.

If the Redirect Target is processed first, the matched_title
field is not populated because that page is not a redirect.
If the Redirect Source is processed first, the matched_title
field IS populated because that page is a redirect.

Either way, we don't have duplicate results (which is the most
important part). Until the logic is consistent, remove the
matched_title check.

Bug: T302706
Change-Id: Ic3977655565aa9f6d6c184749706273b0315b7be
2022-02-28 19:45:18 +00:00
Kosta Harlan
dc828c4aae
api-testing: Run all jobs in a few more tests
Follows-Up: I126d14d552eb060aba6c91764ea54092da7aff21
Change-Id: I4f9a2f16ed0472c27cced2235473837d4499ec8c
2022-02-22 09:26:37 +01:00
Kosta Harlan
8197a4e5f6
api-testing: Run all jobs after edit in Search.js
Change-Id: I126d14d552eb060aba6c91764ea54092da7aff21
2022-02-11 10:59:41 +01:00
Nikki Nikkhoui
9805798a21 Add matched_title field to /search/page results
Add a field to the response object of the REST
endpoint /search/page to display the title of the page
that the given page is a redirect to, or null if
the page is not a redirect.

Bug: T296671
Change-Id: I6673d50e8eae822455972403c82ec33e6ffce5dd
2022-02-08 10:18:46 -05:00
Ed Sanders
8b720e9bd6 eslint: Update to eslint-config-wikimedia 0.16.0
* valid-jsdoc replaced with jsdoc plugin
* New /selenium config

Change-Id: I471eebac0312cb25c539c3f6a3ecfc7cfd4ed8d6
2020-06-02 21:32:56 +01:00
Nikki Nikkhoui
eeac328472 Move Search endpoints into core routes
Move both search endpoints from coreDevelopmentRoutes to coreRoutes, making them
accessible in a production environment.

Change-Id: I14c1a9eb4c76a22f72caa7ae201699d4ef9eb282
2020-05-20 11:52:47 -07:00
Peter Ovchyn
7df7b923da rest: Add 'thumbnail' and 'description' fields to the search response
By default, core adds those fields as null to each row.
provideThumbnail and provideDescription hooks are introduced.
Extension should subscribe on the hooks to provide a thumbnail and description respectively.

Bug: T250144
Change-Id: I42c6c8ff9d887a440174af2a21c7921573b06640
2020-05-05 19:35:52 +03:00
daniel
7d8fe94ea2 SearchHandler: emit Cache-Control header.
Completion search used for type-ahead should make use of http caches,
like ApiOpenSearch does.

Bug: T245675
Change-Id: Ia8366684203381b6c4dc55669a6877e53e9ffe40
2020-04-06 13:37:49 +02:00
daniel
76b703fe5c SearchHandler: add support for completion search
This defines a new REST route, /coredev/v0/search/title

Bug: T246387
Change-Id: Ib8d64f3028d3fa2ce239f922181064a3fc91a488
2020-03-26 20:38:30 +01:00
daniel
c647e16c92 SearchHandler: implement limit parameter
The integration tests in Search.js were copied from the api-testing repo, see
<https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/tools/api-testing/+/refs/heads/master/test/REST/Search.js>

Bug: T245676
Change-Id: Icb4e9b363586914f2c4bcf809bde003d90c017db
2020-03-04 11:13:55 +01:00
Clara Andrew-Wani
aa0ad28c4f Move Search and Watchlist tests from api-testing repo into Core
Bug: T236680
Change-Id: Id1e37791576d27e5e7007387e91270392e7d5904
2020-02-06 00:55:53 +00:00