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

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 triaged this task as Medium priority.
Deskana moved this task from needs triage to Current work on the Discovery-Search board.
Deskana moved this task from Incoming to Needs review on the Discovery-Search (Current work) board.

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.