Searching for snippets with elasticsearch enabled still looks in the database
Elasticsearch indexes snippets, but search queries with elasticsearch enabled always go directly to the database, rather than via ES :(
Steps to reproduce
Do a search. Note that 0 time is spent in elasticsearchin the rails logs.
Also note that
Gitlab::Elastic::SnippetSearchResults is defined in the codebase, but never used.
What is the current bug behavior?
Queries the database
What is the expected correct behavior?
Should query Elasticsearch
Search::SnippetsService needs modifying in EE to call
More generally, it might be a good idea to merge the snippet search service into the global, group, and project search services, for a more unified interface. In the global search, we'd include all snippet types; in group and project search, only project snippets in the specified group or project would be included.
Naive fix partway in https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/10325/diffs