API searches with empty search parameter return 500 errors
This will blow up: https://gitlab.com/api/v4/search?scope=projects&search=
Question: do we even want to execute a search if a user isn't even searching for something?
NoMethodError: undefined method `+' for nil:NilClass
from ee/lib/elastic/latest/project_class_proxy.rb:47:in `block in elastic_search'
from ee/lib/elastic/latest/query_context.rb:25:in `name'
from ee/lib/elastic/latest/project_class_proxy.rb:13:in `elastic_search'
from ee/lib/elastic/multi_version_util.rb:76:in `elastic_search'
from ee/app/models/concerns/elastic/application_versioned_search.rb:40:in `elastic_search'
from ee/lib/gitlab/elastic/search_results.rb:275:in `block in scope_results'
from lib/gitlab/utils/strong_memoize.rb:28:in `strong_memoize'
from ee/lib/gitlab/elastic/search_results.rb:274:in `scope_results'
from ee/lib/gitlab/elastic/search_results.rb:284:in `projects'
from ee/lib/gitlab/elastic/search_results.rb:33:in `objects'
from app/services/search_service.rb:70:in `search_objects'
from lib/api/search.rb:49:in `search'
from lib/api/search.rb:92:in `block (2 levels) in <class:Search>'
Edited by Dmitry Gruzd