Monday, January 6, 2025

Cannot search inside folders on a drive?

I experience a peculiar issue with one of my external drives’ indexing functionality; while I can successfully search the drive’s contents in its entirety, attempting to narrow down the search to a specific folder within it results in no matching files being found.

To illustrate the concept, consider this: I had a file. /Volumes/MyDrive/Photos/Picture.png, if I run:

mdfind -onlyin /Volumes/MyDrive '*.png'

The outcomes will accurately mirror my expectations. Despite potential drawbacks,

mdfind -onlyin /Volumes/MyDrive/Photos '*.png'

Although the picture is indeed present in that folder, no alternative return is provided; however, upon closer examination, it appears that the file is correctly recognized by Highlight, as evidenced by its accurate identification along the designated path.

The issue seems to pertain to traversing any directory across the drive, regardless of its nesting level. This affects newly created folders and their subsequent subfolders, suggesting that it is not related to permissions or extended attributes, as a freshly created folder should inherit default permissions and be attribute-free.

I’ve attempted to recreate the index through the following steps:



To disable metadata writing for the MyDrive volume, run:
```
sudo mdutil -i off /Volumes/MyDrive
```
Next, remove any existing metadata database from the volume with:
```
sudo mdutil -X /Volumes/MyDrive
```
Finally, re-enable metadata writing on the volume with:
```
sudo mdutil -i on /Volumes/MyDrive

After conducting a thorough verification following the initial process, .Highlight-V100 Since the folder has been detached from the drive, enabling indexing should result in a freshly updated index, reflecting all changes made since its physical separation from the drive.

Despite indexing being complete, the issue persists; I’m unable to search within specific folders, as every query must encompass my entire drive or Mac to yield any results whatsoever.

Has anyone ever had alternative approaches for attempting to resolve this issue? What’s the rationale behind Highlight’s synergy? -onlyin What do you mean by “the drive”, referring to which drive exactly? What’s proving to be an unexpected challenge?

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles