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
e0a75d85
Commit
e0a75d85
authored
Jan 13, 2020
by
Dylan Griffith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove support for ES5 and add support for ES7
parent
b62dea0b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
8 deletions
+22
-8
changelogs/unreleased/118662-drop-support-es-v5-support-v7.yml
...elogs/unreleased/118662-drop-support-es-v5-support-v7.yml
+5
-0
ee/lib/gitlab/elastic/helper.rb
ee/lib/gitlab/elastic/helper.rb
+17
-8
No files found.
changelogs/unreleased/118662-drop-support-es-v5-support-v7.yml
0 → 100644
View file @
e0a75d85
---
title
:
Drop support for ES5 add support for ES7
merge_request
:
22859
author
:
type
:
added
ee/lib/gitlab/elastic/helper.rb
View file @
e0a75d85
...
...
@@ -26,20 +26,29 @@ module Gitlab
client
=
proxy
.
client
index_name
=
proxy
.
index_name
# ES5.6 needs a setting enabled to support JOIN datatypes that ES6 does not support...
if
Gitlab
::
VersionInfo
.
parse
(
client
.
info
[
'version'
][
'number'
])
<
Gitlab
::
VersionInfo
.
new
(
6
)
settings
[
'index.mapping.single_type'
]
=
true
create_index_options
=
{
index:
index_name
,
body:
{
settings:
settings
.
to_hash
,
mappings:
mappings
.
to_hash
}
}
# include_type_name defaults to false in ES7. This will ensure ES7
# behaves like ES6 when creating mappings. See
# https://www.elastic.co/blog/moving-from-types-to-typeless-apis-in-elasticsearch-7-0
# for more information. We also can't set this for any versions before
# 6.8 as this parameter was not supported. Since it defaults to true in
# all 6.x it's safe to only set it for 7.x.
if
Gitlab
::
VersionInfo
.
parse
(
client
.
info
[
'version'
][
'number'
]).
major
==
7
create_index_options
[
:include_type_name
]
=
true
end
if
client
.
indices
.
exists?
index:
index_name
client
.
indices
.
delete
index:
index_name
end
client
.
indices
.
create
index:
index_name
,
body:
{
settings:
settings
.
to_hash
,
mappings:
mappings
.
to_hash
}
client
.
indices
.
create
create_index_options
end
# rubocop: enable CodeReuse/ActiveRecord
...
...
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