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&...
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=te... I don't get any categories info
Any help is really appreciated.
Thanks! --Yassine.
2010/10/19 Yassine Benajiba benajibayassine@gmail.com:
http://en.wikipedia.org/w/api.php?action=query&titles=Albert%20Einstein&...
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=te... I don't get any categories info
Use a generator:
http://en.wikipedia.org/w/api.php?action=query&generator=search&gsrw...
This'll get 50 search results for Albert Einstein, then get the first 50 categories for each of those pages.
Roan Kattouw (Catrope)
Oh thanks a lot! ... is it possible to get the snippets as well .. like for each hit I get the title, the snippet and the categories it blongs to?
Thanks a lot, also, let me know if there is a special paper you want me to reference in case I publish this.
Best, --Yassine.
On Tue, Oct 19, 2010 at 11:27 AM, Roan Kattouw roan.kattouw@gmail.com wrote:
2010/10/19 Yassine Benajiba benajibayassine@gmail.com:
http://en.wikipedia.org/w/api.php?action=query&titles=Albert%20Einstein&...
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=te... I don't get any categories info
Use a generator:
http://en.wikipedia.org/w/api.php?action=query&generator=search&gsrw...
This'll get 50 search results for Albert Einstein, then get the first 50 categories for each of those pages.
Roan Kattouw (Catrope)
Mediawiki-api mailing list Mediawiki-api@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
2010/10/19 Yassine Benajiba benajibayassine@gmail.com:
Oh thanks a lot! ... is it possible to get the snippets as well .. like for each hit I get the title, the snippet and the categories it blongs to?
You can't get snippets in generator mode, unfortunately.
Thanks a lot, also, let me know if there is a special paper you want me to reference in case I publish this.
Generators are documented at http://www.mediawiki.org/wiki/API:Query#Generators . There is no paper or publication about the MediaWiki API that I know of.
Roan Kattouw (Catrope)
Ok, Thanks a lot! --Yassine.
On Tue, Oct 19, 2010 at 11:56 AM, Roan Kattouw roan.kattouw@gmail.com wrote:
2010/10/19 Yassine Benajiba benajibayassine@gmail.com:
Oh thanks a lot! ... is it possible to get the snippets as well .. like for each hit I get the title, the snippet and the categories it blongs to?
You can't get snippets in generator mode, unfortunately.
Thanks a lot, also, let me know if there is a special paper you want me to reference in case I publish this.
Generators are documented at http://www.mediawiki.org/wiki/API:Query#Generators . There is no paper or publication about the MediaWiki API that I know of.
Roan Kattouw (Catrope)
Mediawiki-api mailing list Mediawiki-api@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-api
mediawiki-api@lists.wikimedia.org