You can exclude subdirectories with a particular name (along with their contents) by following these steps:
- In the Android Studio search bar, type the name of the project you want to search.
- When the search results appear, click on the dropdown arrow next to the search bar.
- Select "Edit search scope" from the dropdown menu.
- In the "Scope" window that appears, click on the "+" button to add a new scope.
- Give your new scope a name (e.g. "Search without subdirectory").
- In the "Scope Options" section, click on the "Add" button.
- On the "File Path" tab, select "Does not match" in the first dropdown.
- In the second field, type the path to the subdirectory you want to exclude. For example, if your subdirectory is named "build", you should type "/build/" (without the quotes).
- Click on "OK" to save your new scope.
- Back in the search bar dropdown menu, select your new scope from the list of search scopes.
- Your search results will now exclude the subdirectory you specified.