By default, when you use the Search feature in Finder, it tends to search your entire Mac instead of just searching for the current folder. Fortunately, you can make Finder always search for the current folder by changing a setting on your Mac.
When Finder uses the default setting, you must go to the current folder from the top toolbar each time. This can be quite annoying.
You can change this behavior from the Finder preferences.
First, open the Finder application. You can click the Finder icon from the Dock or you can use the Spotlight Search feature.
Then, from the upper left corner of the screen, select the "Finder" button from the menu bar. Then set the "Preferences" option.
Go to the "Advanced" tab from the top.
Here, click on the drop-down menu under "When Performing a Search" and select "Search The Current Folder".
And you are ready. The next time you go to a folder in the Finder and start searching, the current folder will be searched by default.
If you want to browse all the directories, just select "This Mac" from search toolbar.
Source of information: howtogeek.com