Page MenuHomePhabricator

"Go" result should be available through the API
Closed, ResolvedPublic

Description

There should be a way in the API to tell which page you'll be redirected to when you type a certain string in the search box and click "Go". It's possible to get this by requesting http://en.wikipedia.org/w/index.php?title=Special%3ASearch&search=something&go=Go and getting the target of the resulting HTTP 302, but this'll return an HTTP 200 with search results when there is no title match for 'something' and this is hacky. The API should have some way of requesting this so it'll be cleaner and not run a full-blown search with the associated bandwidth usage if there is no title match.


Version: 1.16.x
Severity: enhancement

Details

Reference
bz22339

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:47 PM
bzimport set Reference to bz22339.

matthew.britton wrote:

Done in r64436.

Bryan.TongMinh wrote:

Patch as part of list=search

I needed to change the constructor of SearchResult to get this working. Any objections to this?

Attached:

(In reply to comment #3)

I needed to change the constructor of SearchResult to get this working. Any
objections to this?

You could probably make a static function newFromTitle(), instead of comparing types in constructor.