Author: artur.bekasov
Description:
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:
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:
- It seems like a quite basic use case.
- The problem makes generator=search useless for most people.
I am using the latest API version as installed on Wikipedia wiki.
Version: unspecified
Severity: enhancement