Commit 4cd1d171 authored by Robert Speicher's avatar Robert Speicher

Merge branch 'es_whitlist_for_data' into 'master'

Don't index unnecessary data into elastic

Fixes https://dev.gitlab.org/gitlab/gitlab-ee/issues/347

See merge request !198
parents b8342d20 23d9889d
......@@ -6,6 +6,7 @@ v 8.5.0 (unreleased)
- GitLab Pages gets support for custom domain and custom certificate
- Fix of Elastic indexer. It should not trigger record validation for projects
- Fix of Elastic indexer. Stabilze indexer when serialized data is corrupted
- [Elastic] Don't index unnecessary data into elastic
v 8.4.4
- Re-introduce "Send email to users" link in Admin area
......
......@@ -29,7 +29,20 @@ module Elastic
end
def as_indexed_json(options = {})
as_json(except: :runners_token).merge({
as_json({
only: [
:id,
:name,
:path,
:description,
:namespace_id,
:created_at,
:archived,
:visibility_level,
:last_activity_at,
:last_pushed_at
]
}).merge({
name_with_namespace: name_with_namespace,
path_with_namespace: path_with_namespace
})
......
......@@ -28,12 +28,23 @@ module Elastic
end
def as_indexed_json(options = {})
as_json(
as_json({
only: [
:id,
:title,
:file_name,
:content,
:created_at,
:updated_at,
:state,
:project_id,
:author_id,
],
include: {
project: { only: :id },
author: { only: :id }
}
)
})
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