以编程方式强制 Spotlight 为特定不可见文件类型的元数据建立索引

发布于 2024-08-05 22:49:14 字数 272 浏览 0 评论 0原文

有办法做到这一点吗?

原因是我试图在添加/删除不可见文件和文件夹时强制聚光灯接收自动更新。我认为这种行为是不索引元数据的副作用(但我可能是错的)。我从这个问题得出了这个结论。

解决方案是编写 mdimporter 吗?它甚至适用于不可见的文件类型吗?

Is there a way to accomplish this?

The reason for this is I am trying to force spotlight to receive automatic updates when invisible files and folders are added/removed. This behavior I believe is a side effect of not indexing the meta-data (but I could be wrong). I came to this conclusion from this SO question.

Is the solution writing a mdimporter? Will it even work for invisible file types?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

落在眉间の轻吻 2024-08-12 22:49:14

经过一些研究,似乎没有办法强制对不可见文件夹建立索引。

相反,我正在搜索所有文件夹并获取所有文件夹的更新。 (如果你想知道,仍然很快)

After some research, it seems there is no way to force indexing of invisible folders.

I am instead searching all folders and getting updates for all folders. (Still very fast if you are wondering)

流绪微梦 2024-08-12 22:49:14

我不是 Spotlight 专家,但无论如何我都会尝试一下。

我的理解是 Spotlight 只会索引它所知道的类型的文件。如果您想要索引的文件是自定义类型,那么您将需要编写一个 mdimporter。

我不知道 Spotlight 是否会索引不可见文件。

要强制聚光灯重新运行,请查看 mdimport 命令。

I'm not a Spotlight expert, but I'll take a stab anyway.

My understanding is that Spotlight will only index files of types that it knows about. If the files that you want to have indexed are of a custom type, then you will need to write a mdimporter.

I don't know if Spotlight will index invisible files.

To force spotlight to rerun, check out the mdimport command.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文