OS X Spotlight 从用户定义的数据库中搜索?

发布于 2024-10-03 01:34:05 字数 755 浏览 0 评论 0原文

从 10.5 开始,Mac OS X 上的 Spotlight 具有您可能已经看到的这个不错的字典集成

字典集成 in Spotlight

有什么想法可以实现这样的事情吗?

看来当前的 Dictionary+Spotlight 友谊在某种程度上被硬编码到 Spotlight 的代码中(例如,有一个特定的用户默认键 com.apple.spotlight.DictionaryLookupEnabled 仅用于切换字典搜索)。

我读过 Spotlight 导入器编程指南,仅在每个文档的基础上创建 Spotlight 导入器,也就是说,如果您的应用程序 Foobar 打开/创建文件使用扩展名 .foo,您可以编写一个 Spotlight 导入器来索引这些文件的属性。

然而,我需要的是 Spotlight 以某种方式使用自己的查询查询某种数据库(正是它现在对 Dictionary 所做的事情)。

Since 10.5, Spotlight on Mac OS X has this nice Dictionary integration you might have seen:

Dictionary integration in Spotlight

Any ideas how anything like this could be implemented?

It seems that the current Dictionary+Spotlight friendship is somewhat hardcoded into Spotlight's code (for example, there is a specific user defaults key com.apple.spotlight.DictionaryLookupEnabled present just for toggling dictionary searching).

I've read in the Spotlight Importer Programming Guide that one can create a Spotlight importer only on a per-document basis, that is if your application Foobar opens/creates files with extension .foo, you can then write a Spotlight importer for indexing properties of those files.

What I need, however, is for the Spotlight to somehow query some sort of a database with its own query (exactly what it now does with Dictionary).

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

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

发布评论

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

评论(1

不疑不惑不回忆 2024-10-10 01:34:05

抱歉,那是不可能的;您需要为每个 Spotlight 匹配创建一个文件。提出增强请求。

That's not possible, sorry; you need to create a file per Spotlight match. File an enhancement request.

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