OS X Spotlight 从用户定义的数据库中搜索?
从 10.5 开始,Mac OS X 上的 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:
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
抱歉,那是不可能的;您需要为每个 Spotlight 匹配创建一个文件。提出增强请求。
That's not possible, sorry; you need to create a file per Spotlight match. File an enhancement request.