Search using search api sometimes results in empty responses

I have a question about a problem I am having with the search api on nexus 3.

When using the search api on sonatype nexus 3 and performing a command line search as follows, the results may be empty even though the file exists on nexus.

curl -u : https://<nexus’s domain>/service/rest/v1/search/assets?repository=&group=<group_name>&q=<query_keyword>

Example response on success:.
“items” : [ {
“downloadUrl” : "https://<nexus’s domain>/repository/<repository_name>/<group_name>/<module_name>,
“path” : “<group_name>/<module_name>”,
“repository” : “<repository_name>”,
“format” : “raw”,
“checksum” : {
“sha1” : “8007fe3734db3d67b9f95e41071af79bff28d637”,
“md5” : “c9bcc0b3359b6bd1ba6a376ebe77e64b”
} ],
“continuationToken” : null

Example response when empty:.
“items” : [ ],
“continuationToken” : null

If the response is empty, after logging in to nexus and downloading that file from the screen (GUI), the search results on the command line will respond correctly.

I am having trouble finding the cause of this problem. Can anyone give me some advice on this?
Has anyone ever experienced a similar event?

Is it a proxy repository? Nexus REST API (and UI) only includes content on the server.

Thank you for your comment.
It is a raw repository, not a proxy repository.

You mean it’s a raw hosted repository? You can still have raw proxy repositories.

Yes, it’s a raw hosted repository.
If the search for a file fails, after logging into nexus and downloading that file on the screen, the search for the file will succeed.
Based on the above facts, we suspect that there is a time lag until the elasticsearch index is generated, or there is some other event that is causing the failure.

The search index is updated asynchronously and may take several seconds.