Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
49a4bda0
Commit
49a4bda0
authored
Oct 12, 2021
by
Terri Chu
Committed by
Dmitry Gruzd
Oct 12, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add blob search aggregations for language
parent
91d34066
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
0 deletions
+26
-0
config/feature_flags/development/search_blobs_language_aggregation.yml
...e_flags/development/search_blobs_language_aggregation.yml
+8
-0
ee/lib/elastic/latest/git_class_proxy.rb
ee/lib/elastic/latest/git_class_proxy.rb
+18
-0
No files found.
config/feature_flags/development/search_blobs_language_aggregation.yml
0 → 100644
View file @
49a4bda0
---
name
:
search_blobs_language_aggregation
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/71937
rollout_issue_url
:
https://gitlab.com/gitlab-org/gitlab/-/issues/342621
milestone
:
'
14.4'
type
:
development
group
:
group::global search
default_enabled
:
false
ee/lib/elastic/latest/git_class_proxy.rb
View file @
49a4bda0
...
...
@@ -201,6 +201,24 @@ module Elastic
}
end
if
type
==
'blob'
&&
!
options
[
:count_only
]
&&
::
Feature
.
enabled?
(
:search_blobs_language_aggregation
,
options
[
:current_user
],
default_enabled: :yaml
)
query_hash
[
:aggs
]
=
{
language:
{
composite:
{
sources:
[
{
language:
{
terms:
{
field:
'blob.language'
}
}
}
]
}
}
}
end
# inject the `id` part of repository as project id
repository_ids
=
[
options
[
:repository_id
]].
flatten
options
[
:project_ids
]
=
repository_ids
.
map
{
|
id
|
id
.
to_s
[
/\d+/
].
to_i
}
if
type
==
'wiki_blob'
&&
repository_ids
.
any?
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment