Routing is missing in projects index
Summary
We have moved the projects
documents from the main index to the dedicated -projects
index but we miss to set the routing in the dedicated index. All the documents in the dedicated index must have routing.
Steps to reproduce
Run the following curl command and verify that the routing
field is missing:
curl -H 'Content-type: application/json' -XGET 'http://localhost:9200/gitlab-development-projects/_search' | json_pp
What is the current bug behavior?
routing
is missing in projects
index documents
What is the expected correct behavior?
routing
should not missing in projects
index documents
Relevant logs and/or screenshots
Possible fixes
For project
it is returning nil
. It should return target.id
when target
is project
. Following is the suggestion:
def es_parent
if target.is_a?(Project)
"project_#{target.id}"
elsif target&.project_id
"project_#{target.project_id}"
end
end
After this fix please reindex all the project
documents.