Commit b8342d20 authored by Valery Sizov's avatar Valery Sizov

Merge branch 'es_fix_indexer' into 'master'

[ES indexer] Stabilze indexer when serialized data is corrupted

https://gitlab.com/gitlab-com/operations/issues/56#note_3824850

See merge request !196
parents 48fe8cfa bf50c890
......@@ -4,7 +4,8 @@ v 8.5.0 (unreleased)
- Show warning when mirror repository default branch could not be updated because it has diverged from upstream.
- More reliable wiki indexer
- GitLab Pages gets support for custom domain and custom certificate
- Fix of Elastic indexer. It should not trigger record validation.
- Fix of Elastic indexer. It should not trigger record validation for projects
- Fix of Elastic indexer. Stabilze indexer when serialized data is corrupted
v 8.4.4
- Re-introduce "Send email to users" link in Admin area
......
......@@ -34,13 +34,28 @@ module Elastic
end
def as_indexed_json(options = {})
as_json(
as_json({
only: [
:id,
:iid,
:target_branch,
:source_branch,
:title,
:description,
:created_at,
:updated_at,
:state,
:merge_status,
:source_project_id,
:target_project_id,
:author_id
],
include: {
source_project: { only: :id },
target_project: { only: :id },
author: { only: :id }
}
).merge({ updated_at_sort: updated_at })
}).merge({ updated_at_sort: updated_at })
end
def self.elastic_search(query, options: {})
......
......@@ -18,7 +18,9 @@ module Elastic
end
def as_indexed_json(options = {})
as_json.merge({ updated_at_sort: updated_at })
as_json(
only: [:id, :title, :description, :project_id, :created_at]
).merge({ updated_at_sort: updated_at })
end
def self.elastic_search(query, options: {})
......
......@@ -16,7 +16,9 @@ module Elastic
end
def as_indexed_json(options = {})
as_json.merge({ updated_at_sort: updated_at })
as_json(
only: [:id, :note, :project_id, :created_at]
).merge({ updated_at_sort: updated_at })
end
def self.elastic_search(query, options: {})
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment