Search API returns project_id 0 for all results (blobs elasticsearch)
When using the Search API for blobs (global, group and project search) as explained in the Docs, all result entries contain "project_id": 0
instead of the correct id.
> curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/search?scope=blobs&search=maintainer%20filename:package.xml"
[
{
"basename": "package",
"data": "<meaningful_data>",
"filename": "package.xml",
"id": null,
"ref": "<meaningful_commit_hash>",
"startline": 35,
"project_id": 0
}
]
Summary
The project_id
of Search API requests for blobs is always 0
.
Steps to reproduce
curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/search?scope=blobs&search=installation
Example Project
What is the current bug behavior?
"project_id":0
What is the expected correct behavior?
Meaningful project_id
s, eg.:
> curl --request GET --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/search?scope=blobs&search=maintainer%20filename:package.xml"
[
{
"basename": "package",
"data": "<meaningful_data>",
"filename": "package.xml",
"id": null,
"ref": "<meaningful_commit_hash>",
"startline": 35,
"project_id": 5066
}
]
Relevant logs and/or screenshots
Output of checks
Results of GitLab environment info
I'm not the system admin, so only info I have is that we use GitLab Enterprise Edition 11.8.1-ee
If that's not enough, I can request the environment info and application check.