https://bugzilla.wikimedia.org/show_bug.cgi?id=67131

            Bug ID: 67131
           Summary: Results order when using generator=search
           Product: MediaWiki
           Version: unspecified
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: Unprioritized
         Component: API
          Assignee: wikibugs-l@lists.wikimedia.org
          Reporter: artur.beka...@gmail.com
                CC: bjor...@wikimedia.org, bryan.tongm...@gmail.com,
                    roan.katt...@gmail.com, s...@reedyboy.net
       Web browser: ---
   Mobile Platform: ---

I am trying to use search as a generator, and get summary of every article
found, effectively replicating functionality of the Special:Search page. That's
what I am doing:

http://en.wikipedia.org/w/api.php?action=query&generator=search&gsrsearch=vector%20space&prop=extracts&exintro&exlimit=10&exsentences=1&explaintext

It works nicely, apart from one thing: it appears that the results are sorted
by title. It's a shame, because Lucene does a decent job at ranking the
results, as you can see if you just return a list of results:

http://en.wikipedia.org/w/api.php?action=query&list=search&srsearch=vector%20space&srprop=

So the only way around that I've came up with is to do two requests: query with
list=search to get search results, and then query with prop=extracts to get
summaries of the titles found previously. It seems to work, but you probably
understand that it's not a very reliable/efficient/beautiful solution.

In the comment for another bug
(https://bugzilla.wikimedia.org/show_bug.cgi?id=14859#c1) it has been explained
that respecting the original order of titles is not feasible/desirable.
Generators are basically a different way of providing a list of title, so I can
see why you might not be keen on implementing that. However, I am still keen on
opening this ticket, for two reasons:
  1. It seems like a quite basic use case.
  2. The problem makes generator=search useless for most people.

I am using the latest API version as installed on Wikipedia wiki.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to