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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
0401d00a
Commit
0401d00a
authored
Mar 24, 2019
by
Mario de la Ossa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Backport of avoid_n_plus_1_es_load_blobs
parent
83153e65
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
3 deletions
+10
-3
app/helpers/search_helper.rb
app/helpers/search_helper.rb
+6
-1
app/views/search/_results.html.haml
app/views/search/_results.html.haml
+2
-0
app/views/search/results/_blob.html.haml
app/views/search/results/_blob.html.haml
+1
-1
app/views/search/results/_wiki_blob.html.haml
app/views/search/results/_wiki_blob.html.haml
+1
-1
No files found.
app/helpers/search_helper.rb
View file @
0401d00a
...
...
@@ -33,10 +33,15 @@ module SearchHelper
"Showing
#{
from
}
-
#{
to
}
of
#{
count
}
#{
scope
.
humanize
(
capitalize:
false
)
}
for
\"
#{
term
}
\"
"
end
def
find_project_for_result_blob
(
result
)
def
find_project_for_result_blob
(
projects
,
result
)
@project
end
# Used in EE
def
blob_projects
(
results
)
nil
end
def
parse_search_result
(
result
)
result
end
...
...
app/views/search/_results.html.haml
View file @
0401d00a
...
...
@@ -21,6 +21,8 @@
-
if
@scope
==
'projects'
.term
=
render
'shared/projects/list'
,
projects:
@search_objects
,
pipeline_status:
false
-
elsif
%w[blobs wiki_blobs]
.
include?
(
@scope
)
=
render
partial:
'search/results/blob'
,
collection:
@search_objects
,
locals:
{
projects:
blob_projects
(
@search_objects
)
}
-
else
=
render
partial:
"search/results/
#{
@scope
.
singularize
}
"
,
collection:
@search_objects
...
...
app/views/search/results/_blob.html.haml
View file @
0401d00a
-
project
=
find_project_for_result_blob
(
blob
)
-
project
=
find_project_for_result_blob
(
projects
,
blob
)
-
return
unless
project
-
blob
=
parse_search_result
(
blob
)
...
...
app/views/search/results/_wiki_blob.html.haml
View file @
0401d00a
-
project
=
find_project_for_result_blob
(
wiki_blob
)
-
project
=
find_project_for_result_blob
(
projects
,
wiki_blob
)
-
wiki_blob
=
parse_search_result
(
wiki_blob
)
-
wiki_blob_link
=
project_wiki_path
(
project
,
wiki_blob
.
basename
)
...
...
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