I think we should ignore leading spaces. This matters because people often use the space bar to scroll. Since the search page gives focus to the search field on load, it's easy to search for a space when you meant to scroll the recs.
Search field would ignore a leading space.
Search results come in for a single space: https://wordpress.com/read/search?q=%20
@gibrown - is this right? Or is this a bug?
Hmmm, ya, even worse is that it runs a query that matches all content and tries to sort it so the query times out most of the time... Ya it's a bug. we should handle it better...
Deployed fix to return a 400 error from the API when there is no text in the query being sent.
@samouri the handling when there is an error is not great though, so I think most of this needs to be fixed on the front end. Currently can't really tell the difference between "search is still running" and "no results because there was an error". Seems like in this case though we shouldn't even send the request since there is no visible text in the search.
@gibrown I'll look into fixing it this week
Pinging @samouri to remember this since search is now on the homepage, too.
thanks for the ping @fraying! I totally forgot about this. should be solved shortly!
This is fixed now. 馃帀