Page MenuHomePhabricator

action=query, list=search API not working
Closed, ResolvedPublic

Description

Author: bsrour

Description:
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)

Version: unspecified
Severity: normal

Details

Reference
bz10908

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:52 PM
bzimport set Reference to bz10908.
bzimport added a subscriber: Unknown Object (MLST).

alessandro.larosa wrote:

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.

alessandro.larosa wrote:

(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?

Bryan.TongMinh wrote:

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.

Attached:

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.

Bryan.TongMinh wrote:

Patch to automatically load ApiQueryLuceneSearch

Attached:

Bryan.TongMinh wrote:

Added in r31471. Not very thoroughly tested.

Bryan.TongMinh wrote:

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.

Bryan.TongMinh wrote:

Fixed in r31522.

[Merging "MediaWiki extensions/Lucene Search" into "Wikimedia/lucene-search2", see bug 46542. You can filter bugmail for: search-component-merge-20130326 ]