macOS 下Spotlight Importers概览

Spotlight Importers

介绍:

保存,复制或移动文件后,Spotlight元数据导入程序会从自定义文件格式中提取元数据,然后可以从应用程序(系统应用程序和自定义应用程序)中搜索自定义元数据。 可以在OS X上的本地磁盘和网络存储上搜索文件。

性能:

在创建,复制和修改文件时调用Spotlight导入程序性能至关重要。 Importers 应该能够以最小的代价快速从文件中提取元数据。

避免将元数据深埋在文件内部,尤其是在以后发现元数据计算密集的情况下。 如果性能改进需要,请定义文件格式,以便在文件中的固定或易于访问的位置提供相关信息。

导入器不会泄漏内存也很重要,因为这也会导致性能问题。 请务必使用Instruments和其他提供的分析软件对您的Importers进行分析和测试,以确保其尽可能快。

安装位置:

~/Library/Spotlight
/Library/Spotlight

命令查询已建立的内容:

/usr/bin/mdimport -L

示例:

julius-iMac-4:Contents julius$ /usr/bin/mdimport -L
2018-11-22 11:27:06.320 mdimport[1955:248511] Paths: id(501) (
    "/Library/Spotlight/iWork.mdimporter",
    "/Library/Spotlight/iBooksAuthor.mdimporter",
    "/System/Library/Spotlight/SystemPrefs.mdimporter",
    "/System/Library/Spotlight/Chat.mdimporter",
    "/System/Library/Spotlight/iPhoto.mdimporter",
    "/System/Library/Spotlight/PDF.mdimporter",
    "/System/Library/Spotlight/RichText.mdimporter",
    "/System/Library/Spotlight/Bookmarks.mdimporter",
    "/System/Library/Spotlight/Office.mdimporter",
    "/System/Library/Spotlight/PS.mdimporter",
    "/System/Library/Spotlight/MIDI.mdimporter",
    "/System/Library/Spotlight/Archives.mdimporter",
    "/System/Library/Spotlight/Audio.mdimporter",
    "/System/Library/Spotlight/iPhoto8.mdimporter",
    "/System/Library/Spotlight/Automator.mdimporter",
    "/System/Library/Spotlight/Application.mdimporter",
    "/System/Library/Spotlight/Font.mdimporter",
    "/System/Library/Spotlight/Mail.mdimporter",
    "/System/Library/Spotlight/QuartzComposer.mdimporter",
    "/System/Library/Spotlight/vCard.mdimporter",

这个只是部分程序会创建这样一个索引,方便快速获取数据,按官方介绍应该有回收和使用机制,

New Spotlight importers are detected by comparing the importer’s modification date. If the date is the same as a previously loaded importer, the new importer is not automatically detected.

会比较日期使用最新的。

更多详情参考:

https://developer.apple.com/library/archive/documentation/Carbon/Conceptual/MDImporters/Concepts/Troubleshooting.html#//apple_ref/doc/uid/TP40001690-CJBEJBHH

猜你喜欢

转载自blog.csdn.net/julius_lee/article/details/84337510