locate command searches an index that the system builds periodically.
How to make sure, any new file you're looking is part of index? Is there any explicit command to index?
From the manual (
locate reads one or more databases prepared by updatedb(8) and writes file names matching at least one of the PATTERNs to standard output, one per line.
updatedb writes the database. It is typically already set up to run periodically from cron in many systems. It should not be possible to update the system locate database as a regular user. So, perhaps
sudo updatedb works best in many systems.