FOSS Master broken due to SearchService#use_elasticsearch? not available

Likely caused by !41411 (merged).

See:

  1. https://gitlab.com/gitlab-org/gitlab-foss/-/jobs/751922718
  2. https://gitlab.com/gitlab-org/gitlab-foss/-/jobs/751922785
  3. https://gitlab.com/gitlab-org/gitlab-foss/-/jobs/751922761
  1) search/_results displays the page size
     Failure/Error: - if search_service.use_elasticsearch? && @search_highlight[issue.id]&.description.present?
     ActionView::Template::Error:
       undefined method `use_elasticsearch?' for #<SearchService:0x00005617502f95c8>
     # ./app/views/search/results/_issue.html.haml:13:in `_app_views_search_results__issue_html_haml___927641577042553242_47329064205920'
     # ./app/views/search/_results.html.haml:37:in `_app_views_search__results_html_haml__2606713446183815247_47329063151060'
     # ./spec/views/search/_results.html.haml_spec.rb:20:in `block (2 levels) in <top (required)>'
     # ./spec/spec_helper.rb:340:in `block (3 levels) in <top (required)>'
     # ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
     # ./spec/spec_helper.rb:331:in `block (2 levels) in <top (required)>'
     # ./spec/spec_helper.rb:327:in `block (3 levels) in <top (required)>'
     # ./spec/spec_helper.rb:327:in `block (2 levels) in <top (required)>'
     # ------------------
     # --- Caused by: ---
     # NoMethodError:
     #   undefined method `use_elasticsearch?' for #<SearchService:0x00005617502f95c8>
     #   ./app/views/search/results/_issue.html.haml:13:in `_app_views_search_results__issue_html_haml___927641577042553242_47329064205920'
  2) search/_results when search results do not have a count does not display the page size
     Failure/Error: - if search_service.use_elasticsearch? && @search_highlight[issue.id]&.description.present?
     ActionView::Template::Error:
       undefined method `use_elasticsearch?' for #<SearchService:0x000056174cf31920>
     # ./app/views/search/results/_issue.html.haml:13:in `_app_views_search_results__issue_html_haml___927641577042553242_47329064205920'
     # ./app/views/search/_results.html.haml:37:in `_app_views_search__results_html_haml__2606713446183815247_47329063151060'
     # ./spec/views/search/_results.html.haml_spec.rb:31:in `block (3 levels) in <top (required)>'
     # ./spec/spec_helper.rb:340:in `block (3 levels) in <top (required)>'
     # ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
     # ./spec/spec_helper.rb:331:in `block (2 levels) in <top (required)>'
     # ./spec/spec_helper.rb:327:in `block (3 levels) in <top (required)>'
     # ./spec/spec_helper.rb:327:in `block (2 levels) in <top (required)>'
     # ------------------
     # --- Caused by: ---
     # NoMethodError:
     #   undefined method `use_elasticsearch?' for #<SearchService:0x000056174cf31920>
     #   ./app/views/search/results/_issue.html.haml:13:in `_app_views_search_results__issue_html_haml___927641577042553242_47329064205920'
  3) search/_results rendering all types of search results when scope is issues renders the click text event tracking attributes
     Failure/Error: - if search_service.use_elasticsearch? && @search_highlight[issue.id]&.description.present?
     ActionView::Template::Error:
       undefined method `use_elasticsearch?' for #<SearchService:0x000056174a5cef38>
     # ./app/views/search/results/_issue.html.haml:13:in `_app_views_search_results__issue_html_haml___927641577042553242_47329064205920'
     # ./app/views/search/_results.html.haml:37:in `_app_views_search__results_html_haml__2606713446183815247_47329063151060'
     # ./spec/views/search/_results.html.haml_spec.rb:52:in `block (5 levels) in <top (required)>'
     # ./spec/spec_helper.rb:340:in `block (3 levels) in <top (required)>'
     # ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
     # ./spec/spec_helper.rb:331:in `block (2 levels) in <top (required)>'
     # ./spec/spec_helper.rb:327:in `block (3 levels) in <top (required)>'
     # ./spec/spec_helper.rb:327:in `block (2 levels) in <top (required)>'
     # ------------------
     # --- Caused by: ---
     # NoMethodError:
     #   undefined method `use_elasticsearch?' for #<SearchService:0x000056174a5cef38>
     #   ./app/views/search/results/_issue.html.haml:13:in `_app_views_search_results__issue_html_haml___927641577042553242_47329064205920'
  4) search/_results rendering all types of search results when scope is issues renders the state filter drop down
     Failure/Error: - if search_service.use_elasticsearch? && @search_highlight[issue.id]&.description.present?
     ActionView::Template::Error:
       undefined method `use_elasticsearch?' for #<SearchService:0x0000561749733140>
     # ./app/views/search/results/_issue.html.haml:13:in `_app_views_search_results__issue_html_haml___927641577042553242_47329064205920'
     # ./app/views/search/_results.html.haml:37:in `_app_views_search__results_html_haml__2606713446183815247_47329063151060'
     # ./spec/views/search/_results.html.haml_spec.rb:59:in `block (5 levels) in <top (required)>'
     # ./spec/spec_helper.rb:340:in `block (3 levels) in <top (required)>'
     # ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
     # ./spec/spec_helper.rb:331:in `block (2 levels) in <top (required)>'
     # ./spec/spec_helper.rb:327:in `block (3 levels) in <top (required)>'
     # ./spec/spec_helper.rb:327:in `block (2 levels) in <top (required)>'
     # ------------------
     # --- Caused by: ---
     # NoMethodError:
     #   undefined method `use_elasticsearch?' for #<SearchService:0x0000561749733140>
     #   ./app/views/search/results/_issue.html.haml:13:in `_app_views_search_results__issue_html_haml___927641577042553242_47329064205920'
Finished in 17 minutes 58 seconds (files took 46.98 seconds to load)
3127 examples, 4 failures, 34 pending
Failed examples:
rspec ./spec/views/search/_results.html.haml_spec.rb:19 # search/_results displays the page size
rspec ./spec/views/search/_results.html.haml_spec.rb:30 # search/_results when search results do not have a count does not display the page size
rspec './spec/views/search/_results.html.haml_spec.rb[1:3:1:1]' # search/_results rendering all types of search results when scope is issues renders the click text event tracking attributes
rspec './spec/views/search/_results.html.haml_spec.rb[1:3:1:2]' # search/_results rendering all types of search results when scope is issues renders the state filter drop down
SimpleCov failed with exit 1