Last modified: 2014-11-18 18:07:32 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T23081, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 21081 - Exact search does not work with the API
Exact search does not work with the API
Status: RESOLVED INVALID
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
1.16.x
All All
: Normal normal with 1 vote (vote)
: ---
Assigned To: Roan Kattouw
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-10-10 12:24 UTC by Tisza Gergő
Modified: 2014-11-18 18:07 UTC (History)
6 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Tisza Gergő 2009-10-10 12:24:56 UTC
Try searching for the word "kíváló" (a misspelling of "kiváló") on Hungarian Wikipedia: http://hu.wikipedia.org/wiki/Speci%C3%A1lis:Keres%C3%A9s/k%C3%ADv%C3%A1l%C3%B3
You get thousands of hits, because the search algorithm does not differentiate between the two words.

Now try the same search, but put double quotes around the word: http://hu.wikipedia.org/wiki/Speci%C3%A1lis:Keres%C3%A9s/%22k%C3%ADv%C3%A1l%C3%B3%22
This will return exact matches only (and thus it is a good way to find typos).

The same does not work with the API: http://hu.wikipedia.org/w/api.php?action=query&list=search&srsearch=k%C3%ADv%C3%A1l%C3%B3&srwhat=text has similar results as the normal search for the same string (though the number of results is slightly different), but http://hu.wikipedia.org/w/api.php?action=query&list=search&srsearch=%22k%C3%ADv%C3%A1l%C3%B3%22&srwhat=text returns no results.
Comment 1 Tisza Gergő 2009-10-10 12:25:56 UTC
Also, searching for a double quote character and nothing else gives a "text search disabled" error: http://hu.wikipedia.org/w/api.php?action=query&list=search&srsearch=%22&srwhat=text 
Comment 2 Robert Stojnic 2009-11-06 14:56:39 UTC
You cannot search for the double-quote character, and the queries you give seem fine to me. Please check user preferences for your user and bot to verify you are searching the same namespaces.. 
Comment 3 Tisza Gergő 2009-11-06 15:29:49 UTC
User preferences should not influence API results, and even if they did, that would not explain differences between API and normal search. Anyway, the queries work fine now, so whatever caused the bug must have been fixed in the meanwhile.
Comment 4 Roan Kattouw 2009-11-06 19:10:45 UTC
(In reply to comment #3)
> User preferences should not influence API results
They should, and they do so consistently. People have actually /requested/ that bots' preferences be taken into account for certain actions (most notably preferences such as "watch all pages I edit" or "mark all my edits as minor")
Comment 5 Tisza Gergő 2009-11-06 19:46:10 UTC
Well they certainly do not do so consistently. When I click on the normal search link, I get 25 results - 2 in article namespace, the rest in project. When I click on the API search link, I only get the two mainspace hits. Both searches use the same keyword and no other parameters.
Comment 6 Roan Kattouw 2009-11-06 19:53:41 UTC
(In reply to comment #5)
> Well they certainly do not do so consistently. When I click on the normal
> search link, I get 25 results - 2 in article namespace, the rest in project.
> When I click on the API search link, I only get the two mainspace hits. Both
> searches use the same keyword and no other parameters.
> 
I guess you're right, for searches this is not true: srnamespace defaults to 0.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links