elasticsearch: initial indexing: project snippets are indexed twice
The following discussion from !14095 (merged) should be addressed:
Hmm come to think of it, this is only needed for
ProjectSnippet's are included in
IndexRecordServiceshould catch them already.
gitlab:elastic:index, we run
gitlab:elastic:index_projects - which indexes the relevant
ProjectSnippet for the limited projects - followed by
gitlab:elastic:index_snippets - which indexes all snippets. So they get indexed twice in the global case, unnecessarily.
We could make
index_snippets only index personal snippets. However, in the limited elasticsearch case, this would be broken.
At present, the snippet search service does not take account of the elasticsearch limited settings - it assumes all snippets are always indexed, even when limitations are active. So at the global level, with limited indexing enabled, it still uses elasticsearch to find results.
We need to resolve this before we can remove the duplication, I think.