Last modified: 2014-07-27 20:59:58 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T70515, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 68515 - api generator query does not preserve search result order
api generator query does not preserve search result order
Status: RESOLVED DUPLICATE of bug 67131
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
unspecified
All All
: Unprioritized normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-07-24 16:32 UTC by Jörn Hees
Modified: 2014-07-27 20:59 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Jörn Hees 2014-07-24 16:32:21 UTC
If i search Wikipedia for something like "cain abel" the results are ordered:
https://en.wikipedia.org/w/index.php?title=Special%3ASearch&profile=default&search=cain+abel&fulltext=Search

The top-page is what i'd expect.

This returns articles in the same order via the API:
http://en.wikipedia.org/w/api.php?format=json&action=query&redirects&list=search&srlimit=10&srsearch=cain%20abel :
"query": {
    "searchinfo": {
        "totalhits": 705
    },
    "search": [
        {
            "ns": 0,
            "title": "Cain and Abel",
            "snippet": "<span class='searchmatch'>Cain</span> and <span class='searchmatch'>Abel</span>. (הֶבֶל ,קַיִן. Qayin, Hevel) were, according to the Book of Genesis , - two sons of Adam and Eve . <span class='searchmatch'>Cain</span> is described as a crop <b>...</b> ",
            "size": 36249,
            "wordcount": 5321,
            "timestamp": "2014-07-21T17:49:45Z"
        },
        {
            "ns": 0,
            "title": "Cains & Abels",
            "snippet": "<span class='searchmatch'>Cains</span> & <span class='searchmatch'>Abels</span> is a musical group originally from Grand Rapids , Michigan currently based in Chicago , Illinois . The band consists of <b>...</b> ",
            "size": 2956,
            "wordcount": 353,
            "timestamp": "2013-03-20T09:54:19Z"
        },
        ...,
        {
            "ns": 0,
            "title": "Abel Cain",
            "snippet": "<span class='searchmatch'>Abel</span> <span class='searchmatch'>Cain</span> (formerly Sons of El Topo) is a stalled film project written and directed by Alejandro Jodorowsky . It is being produced and <b>...</b> ",
            "size": 5560,
            "wordcount": 791,
            "timestamp": "2014-07-05T14:21:17Z"
        },
...


If i now want further info about each of the pages i can use a generator like this:
http://en.wikipedia.org/w/api.php?format=json&action=query&redirects=&indexpageids=&prop=info|categories&clcategories=Category:Disambiguation%20pages&generator=search&gsrlimit=10&gsrsearch=cain%20abel :
"query": {

    "searchinfo": {
        "totalhits": 705
    },
    "pageids": [
        "30350202",
        "192648",
        "31398296",
        "430215",
        "24807625",
        "25433348",
        "4215000",
        "29923085",
        "30158033",
        "23087052"
    ],
    "pages": {
        "30350202": {
            "pageid": 30350202,
            "ns": 0,
            "title": "Abel Cain",
            "contentmodel": "wikitext",
            "pagelanguage": "en",
            "touched": "2014-07-05T14:21:18Z",
            "lastrevid": 615697869,
            "counter": "",
            "length": 5560
        },
        "192648": {
            "pageid": 192648,
            "ns": 0,
            "title": "Cain and Abel",
            "contentmodel": "wikitext",
            "pagelanguage": "en",
            "touched": "2014-07-24T10:18:49Z",
            "lastrevid": 617875627,
            "counter": "",
            "length": 36249
        },
...


The generator seems to re-order the pages by title. The first result now is not what i'd expect anymore :(.

If you reduce the gsrlimit to 1 you can observe that the underlying search seems to have passed the correct page first.

Is there any chance the pageids could be ordered as returned by the providing function?
Comment 1 Brad Jorsch 2014-07-27 20:35:38 UTC

*** This bug has been marked as a duplicate of bug 14859 ***
Comment 2 Jörn Hees 2014-07-27 20:59:58 UTC
sorry for dup, but it's rather on 67131 than 14859...

*** This bug has been marked as a duplicate of bug 67131 ***

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links