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
73a3bc83
Commit
73a3bc83
authored
Aug 02, 2021
by
Terri Chu
Committed by
charlie ablett
Aug 02, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support displaying indexed filenames for large files
parent
019cc163
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
25 additions
and
10 deletions
+25
-10
GITLAB_ELASTICSEARCH_INDEXER_VERSION
GITLAB_ELASTICSEARCH_INDEXER_VERSION
+1
-1
app/views/search/results/_blob_data.html.haml
app/views/search/results/_blob_data.html.haml
+9
-2
doc/administration/instance_limits.md
doc/administration/instance_limits.md
+2
-2
ee/app/views/admin/application_settings/_elasticsearch_form.html.haml
.../admin/application_settings/_elasticsearch_form.html.haml
+1
-1
ee/spec/lib/gitlab/elastic/indexer_spec.rb
ee/spec/lib/gitlab/elastic/indexer_spec.rb
+8
-3
locale/gitlab.pot
locale/gitlab.pot
+4
-1
No files found.
GITLAB_ELASTICSEARCH_INDEXER_VERSION
View file @
73a3bc83
2.1
2
.0
2.1
3
.0
app/views/search/results/_blob_data.html.haml
View file @
73a3bc83
...
...
@@ -7,5 +7,12 @@
=
search_blob_title
(
project
,
path
)
=
copy_file_path_button
(
path
)
-
if
blob
.
data
-
if
blob
.
data
.
size
>
0
.file-content.code.term
{
data:
{
qa_selector:
'file_text_content'
}
}
=
render
'shared/file_highlight'
,
blob:
blob
,
first_line_number:
blob
.
startline
,
blob_link:
blob_link
,
highlight_line:
blob
.
highlight_line
-
else
.file-content.code
.nothing-here-block
.gl-text-gray-600.gl-font-sm
-
max_file_size_indexed
=
Gitlab
::
CurrentSettings
.
elasticsearch_indexed_file_size_limit_kb
.
kilobytes
=
_
(
'The file could not be displayed because it is empty or larger than the maximum file size indexed (%{size}).'
)
%
{
size:
number_to_human_size
(
max_file_size_indexed
)
}
doc/administration/instance_limits.md
View file @
73a3bc83
...
...
@@ -626,8 +626,8 @@ Reports that go over the 20 MB limit won't be loaded. Affected reports:
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/8638) in GitLab 13.3.
You can set a limit on the content of repository files that are indexed in
Elasticsearch. Any files larger than this limit
is neither indexed
nor searchable.
Elasticsearch. Any files larger than this limit
only index the file name.
The file content is neither indexed
nor searchable.
Setting a limit helps reduce the memory usage of the indexing processes and
the overall index size. This value defaults to
`1024 KiB`
(1 MiB) as any
...
...
ee/app/views/admin/application_settings/_elasticsearch_form.html.haml
View file @
73a3bc83
...
...
@@ -109,7 +109,7 @@
=
f
.
label
:elasticsearch_indexed_file_size_limit_kb
,
_
(
'Maximum file size indexed (KiB)'
),
class:
'label-bold'
=
f
.
number_field
:elasticsearch_indexed_file_size_limit_kb
,
value:
@application_setting
.
elasticsearch_indexed_file_size_limit_kb
,
class:
'form-control gl-form-input'
.form-text.gl-text-gray-600.gl-mt-0
=
_
(
'Any files larger than this limit
will not be indexed, and thus will not be
searchable.'
)
=
_
(
'Any files larger than this limit
only index the file name. The file content is neither indexed nor
searchable.'
)
.form-group
=
f
.
label
:elasticsearch_indexed_field_length_limit
,
_
(
'Maximum field length'
),
class:
'label-bold'
...
...
ee/spec/lib/gitlab/elastic/indexer_spec.rb
View file @
73a3bc83
...
...
@@ -370,10 +370,15 @@ RSpec.describe Gitlab::Elastic::Indexer do
index_repository
(
project
)
end
it
'
does not index that file
'
do
it
'
indexes the file with empty content
'
do
files
=
indexed_file_paths_for
(
'file'
)
expect
(
files
).
to
include
(
'small_file.txt'
)
expect
(
files
).
not_to
include
(
'large_file.txt'
)
expect
(
files
).
to
include
(
'small_file.txt'
,
'large_file.txt'
)
blobs
=
Repository
.
elastic_search
(
'large_file'
,
type:
'blob'
)[
:blobs
][
:results
].
response
large_file_blob
=
blobs
.
find
do
|
blob
|
'large_file.txt'
==
blob
[
'_source'
][
'blob'
][
'path'
]
end
expect
(
large_file_blob
[
'_source'
][
'blob'
][
'content'
]).
to
eq
(
''
)
end
end
...
...
locale/gitlab.pot
View file @
73a3bc83
...
...
@@ -3903,7 +3903,7 @@ msgstr ""
msgid "Any encrypted tokens"
msgstr ""
msgid "Any files larger than this limit
will not be indexed, and thus will not be
searchable."
msgid "Any files larger than this limit
only index the file name. The file content is neither indexed nor
searchable."
msgstr ""
msgid "Any label"
...
...
@@ -32831,6 +32831,9 @@ msgstr ""
msgid "The file containing the export is not available yet; it may still be transferring. Please try again later."
msgstr ""
msgid "The file could not be displayed because it is empty or larger than the maximum file size indexed (%{size})."
msgstr ""
msgid "The file has been successfully created."
msgstr ""
...
...
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