[Mediawiki-api] search in text & restrict categories

Yassine Benajiba benajibayassine at gmail.com
Tue Oct 19 13:18:52 UTC 2010


Hi,

I want to use MediaWiki API in order
to get some medical information. For now, I use only the wget and once
I see if it fits what I need I will probobly switch to Java and Perl
API in order to benefit from the 500 search limit that the bots have.

Here is my question: I want to restrict my search only to pages that
belong to medical categories (I mean, I am not interested in any pages
that don't belong to medical categories), but I still want to use
list=search&srsearch=<myQuery> and not title=<myQuery>.

If restricting the quesry to a certain category, is it possible to get
the list of categories to which a search result belongs. I found out
how to do that when I use: action=quesy&titles=...
For instance:
http://en.wikipedia.org/w/api.php?action=query&titles=Albert%20Einstein&prop=info|categoryinfo|categories&format=xml

how can I get the same info by using list=search. For instance, when I do:
http://en.wikipedia.org/w/api.php?action=query&list=search&srwhat=text&srsearch=Albert%20Einstein&prop=categories&format=xml&sroffset=0&srlimit=50
I don't get any categories info

Any help is really appreciated.

Thanks!
--Yassine.



More information about the Mediawiki-api mailing list