Page MenuHomePhabricator

don't fatal on empty search requests
Closed, ResolvedPublic

Description

How to reproduce:

perform empty search

get a fatal.

log error:

{"id":"WBMcZwpAIDIAAHvzlbUAAAAM","type":"RuntimeException","file":"/srv/mediawiki/php-1.28.0-wmf.23/extensions/CirrusSearch/includes/ElasticsearchIntermediary.php","line":113,"message":"No search request was made","code":0,"url":"/?search=%E3%80%80","back

Event Timeline

Matanya created this task.Oct 28 2016, 10:41 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 28 2016, 10:41 AM
Restricted Application added a project: Discovery. · View Herald TranscriptOct 28 2016, 11:00 AM

Change 318548 had a related patch set uploaded (by DCausse):
Fix errors when searching ideographic whitespaces and keep track of the original query

https://gerrit.wikimedia.org/r/318548

Deskana assigned this task to dcausse.Oct 30 2016, 1:14 AM
Deskana triaged this task as Normal priority.
Deskana moved this task from needs triage to Current work on the Discovery-Search board.
Deskana moved this task from in progress to Needs review on the Discovery-Search (Current work) board.
TJones added a subscriber: TJones.Oct 31 2016, 4:26 PM

I looked at the patch and it looks like it will do the trick. While it would avoid the fatal error in the bug, should we also do something with other space characters? Several starting at U+2000 (%E2%80%8A) return the same 4 results on enwiki, 2 on frwiki, and 3 on dewiki—with the apostrophe article being common to all the results. Something interesting is going on there, but if it's out of scope for this ticket, that's fine.

I've merged the existing patch. I think the other space characters probably deserve a ticket of their own?

Change 318548 merged by jenkins-bot:
Fix errors when searching ideographic whitespaces and keep track of the original query

https://gerrit.wikimedia.org/r/318548

@TJones: the main purpose of excluding U+3000 is that it was generating a match_all query (according to the comment in the code). It is expensive and does not bring any particular benefits. I did not look deeply into other whitespaces but since they do return some results I'm fine keeping them (performance wise).
If you have other concerns I'm OK to explore possible solutions and dig into this.

Deskana closed this task as Resolved.Nov 17 2016, 9:46 PM