Last modified: 2013-03-26 11:24:42 UTC
When I try and remotely invoke a search query to the Wikipedia API I get back a null set of results. Ben Srour wrote: > Hello, > > I am having trouble calling this url: > http://en.wikipedia.org/w/api.php?action=query&list=search&srsearch=wikipedia&srlimit=10 > > All I get is: > <?xml version="1.0" encoding="utf-8"?> > <api> > <query> > <search /> > </query> > </api> > > > What's up? Is this not yet implemented, turned off? Any help here > would be really appreciated. LuceneSearch extension and MWSearch extension need to be merged in an appropriate way so the API can get access to search results. - -- brion vibber (brion @ wikimedia.org)
Any news about this bug?
(In reply to comment #1) > Any news about this bug? Well, no, no one has worked on making Lucene API-friendly AFAIK.
(In reply to comment #2) > Well, no, no one has worked on making Lucene API-friendly AFAIK. Thanks for the answer Roan. Anyway, is there any search API alternatives at the moment?
Created attachment 4686 [details] Initial version of ApiQueryLuceneSearch.php Attached a first version of my ApiQueryLuceneSearch.php extension module. I do not have Lucene working, so it is untested. Currently only the fulltext search function of Lucene is supported.
Nice work, Bryan, although you can lose Yuri's copyright line in favor of yours (you're the one who wrote the module, after all). You might wanna write up another patch that integrates this into the LuceneSearch extension (add it to $wgAPIModules in LuceneSearch's setup code) and ask someone with Lucene (the TestWiki folks, maybe?) to test it.
Created attachment 4688 [details] Patch to automatically load ApiQueryLuceneSearch
Added in r31471. Not very thoroughly tested.
Appears to be working except the part that outputs the titles: See <http://commons.wikimedia.org/w/api.php?action=query&list=search&srsearch=sheep&sroffset=10&format=jsonfm>. ApiQueryLuceneSearch::formatItem appears to be returning null.
I can't debug this as I don't have Lucene. It could be that $result->getTitle() (line 81) is null.
Fixed in r31522.
[Merging "MediaWiki extensions/Lucene Search" into "Wikimedia/lucene-search2", see bug 46542. You can filter bugmail for: search-component-merge-20130326 ]