views:

53

answers:

1

The original search runs fine, but any changes to invisible items go unnoticed by the query.

The query can be ran again and it will find the updates.

The query is non-nil and spotlight notifications have not been unsubscribed.

Is this a bug or expected behavior?

I have tested this several times in a few different projects and it seems to hold true.

A: 

One technique for saving a document bundle is to take advantage of the fact that Spotlight does not import metadata from invisible files or directories.

Emphasis added; quote from a page of the Spotlight Overview.

Peter Hosey
So the end result in my case is updates are not posted for invisible files (and also explains the long search time for invisible files). Is there a way to change this behavior for certain invisible file types as to be notified of invisible file updates (or am I out of luck)?
Corey Floyd
Or is my only solution to just perform a manual search at a specified interval (not a very clean solution)?
Corey Floyd
Spotlight doesn't import invisible items, so you can't use it to find invisible items. You should be able to use FSEvents instead; you will have to scan the directory yourself, but at least you don't have to do it on a polling timer.
Peter Hosey
Spotlight actually does find the invisible items, it just doesn't send update notifications updates. It is a bit slow, so as you said it isn't using the index. Possibly it is just running a regular search of the file system. It seems I may have to set up an update interval as you said (Which I can't imagine will be too bad performance wise).
Corey Floyd
I didn't say an update interval; *you* said a polling interval. I suggested FSEvents instead, which would mean you wouldn't need to poll.
Peter Hosey