我现在还在El Capitan中用Macbook Air 2013-mid的新组件(主板,3x SSD)重现了该问题。在进行测试时,我已经全新安装了OS X(El Capitan,优胜美地)。.tex搜索可用的最新OS X在Spotlight中是10.8.5。目前,我在Spotlight搜索中看不到任何.tex文档。测验
- 当前没有答案永久解决问题。在优胜美地,问题很快恢复了,并给出了一些答案。没有稳定的解决方案,也很少了解导致问题的原因。
在Spotlight中,设置配置的选择无关紧要,因为我们可以直接mdfind
在终端中使用命令,这等效于Spotlight。但是,我们在Spotlight中尝试了默认,最小和完全设置。对于测试,我们使用OS X中的默认设置。系统和应用程序
- 系统OS X优胜美地,OS X El Capitan
- TexShop.app已安装。(MacTeX 2015,mactex-20150613.pkg)。
- Tex应用程式:TextMate2-beta8
- Spotlight / Finder /任何搜索应用程序不适用于TeX文件和MacTeX 2015
- Spotlight在某些不同的设置下以及MacTeX 2015都能按预期工作。
该命令mdfind
(2004年6月10日版本)等效于Spotlight搜索,因此是一个简单的测试,在我的系统中未成功返回任何内容
mdfind sulfas | grep tex
我认为问题在于系统无法识别文件格式.tex`。首先是让系统识别它。
tjt263建议仅在Finder / Spotlight中搜索.tex
Spotlight .tex
或terminal命令的输出在我的系统中正确提供了tex -files。但是,将其与其他术语(如by)组合.tex diabetes
,将不再提供tex文件。进口商mdimport -L
:
2015-09-22 15:31:42.352 mdimport[8163:707] Paths: id(502) (
"/Library/Spotlight/iBooksAuthor.mdimporter",
"/Library/Spotlight/iWork.mdimporter",
"/Library/Spotlight/Microsoft Office.mdimporter",
"/System/Library/Spotlight/Application.mdimporter",
"/System/Library/Spotlight/Archives.mdimporter",
"/System/Library/Spotlight/Audio.mdimporter",
"/System/Library/Spotlight/Automator.mdimporter",
"/System/Library/Spotlight/Bookmarks.mdimporter",
"/System/Library/Spotlight/Chat.mdimporter",
"/System/Library/Spotlight/CoreMedia.mdimporter",
"/System/Library/Spotlight/Font.mdimporter",
"/System/Library/Spotlight/iCal.mdimporter",
"/System/Library/Spotlight/Image.mdimporter",
"/System/Library/Spotlight/iPhoto.mdimporter",
"/System/Library/Spotlight/iPhoto8.mdimporter",
"/System/Library/Spotlight/Mail.mdimporter",
"/System/Library/Spotlight/MIDI.mdimporter",
"/System/Library/Spotlight/Notes.mdimporter",
"/System/Library/Spotlight/PDF.mdimporter",
"/System/Library/Spotlight/PS.mdimporter",
"/System/Library/Spotlight/QuartzComposer.mdimporter",
"/System/Library/Spotlight/RichText.mdimporter",
"/System/Library/Spotlight/SystemPrefs.mdimporter",
"/System/Library/Spotlight/vCard.mdimporter",
"/Applications/Microsoft Office 2011/Microsoft Outlook.app/Contents/Library/Spotlight/Microsoft Outlook.mdimporter",
"/Applications/Xcode.app/Contents/Library/Spotlight/uuid.mdimporter",
"/Applications/DjView.app/Contents/Library/Spotlight/DjVu.mdimporter"
)
bmikes的测试
无法在Finder中搜索文件notes.tex。我将其更改为notes.txt,现在可以在Finder中搜索。这建议我不是搜索程序问题(Spotlight,md ...,无论您使用什么,正如我在评论中多次描述的那样)。因此,系统中的tex问题。同一文件的输出,但具有两个不同的结尾。txt -file的输出:
15:42:23:Desktop:masi$ mdls 8.9.2015.txt
kMDItemContentCreationDate = 2015-09-22 13:38:31 +0000
kMDItemContentModificationDate = 2015-09-22 13:38:31 +0000
kMDItemContentType = "public.plain-text"
kMDItemContentTypeTree = (
"public.plain-text",
"public.text",
"public.data",
"public.item",
"public.content"
)
kMDItemDateAdded = 2015-09-22 13:39:22 +0000
kMDItemDisplayName = "8.9.2015.txt"
kMDItemFSContentChangeDate = 2015-09-22 13:38:31 +0000
kMDItemFSCreationDate = 2015-09-22 13:38:31 +0000
kMDItemFSCreatorCode = ""
kMDItemFSFinderFlags = 0
kMDItemFSHasCustomIcon = 0
kMDItemFSInvisible = 0
kMDItemFSIsExtensionHidden = 0
kMDItemFSIsStationery = 0
kMDItemFSLabel = 0
kMDItemFSName = "8.9.2015.txt"
kMDItemFSNodeCount = 62503
kMDItemFSOwnerGroupID = 20
kMDItemFSOwnerUserID = 502
kMDItemFSSize = 62503
kMDItemFSTypeCode = ""
kMDItemKind = "Plain Text Document"
kMDItemLogicalSize = 62503
kMDItemPhysicalSize = 65536
tex -file的输出:
15:42:27:Desktop:masi$ mdls 8.9.2015.tex
kMDItemContentCreationDate = 2015-09-22 13:38:31 +0000
kMDItemContentModificationDate = 2015-09-22 13:38:31 +0000
kMDItemContentType = "org.tug.tex"
kMDItemContentTypeTree = (
"org.tug.tex",
"public.text",
"public.data",
"public.item",
"public.content"
)
kMDItemDateAdded = 2015-09-22 13:42:37 +0000
kMDItemDisplayName = "8.9.2015.tex"
kMDItemFSContentChangeDate = 2015-09-22 13:38:31 +0000
kMDItemFSCreationDate = 2015-09-22 13:38:31 +0000
kMDItemFSCreatorCode = ""
kMDItemFSFinderFlags = 0
kMDItemFSHasCustomIcon = 0
kMDItemFSInvisible = 0
kMDItemFSIsExtensionHidden = 0
kMDItemFSIsStationery = 0
kMDItemFSLabel = 0
kMDItemFSName = "8.9.2015.tex"
kMDItemFSNodeCount = 62503
kMDItemFSOwnerGroupID = 20
kMDItemFSOwnerUserID = 502
kMDItemFSSize = 62503
kMDItemFSTypeCode = ""
kMDItemKind = "TeX document"
kMDItemLogicalSize = 62503
kMDItemPhysicalSize = 65536
所需命令:
mkdir /Users/masi/Desktop/masi
18:07:56:~:masii$ cp /tmp/8.9.2015.tex /Users/masi/Desktop/masi/
18:08:09:~:masi$ cd /Users/masi/Desktop/masi/
18:08:16:masi:masi$ echo osteoporosis > test_file.txt
18:08:24:masi:masi$ mdfind osteoporosis |grep /Users/masi/Desktop/masi/
/Users/masi/Desktop/masi/test_file.txt
18:08:47:masi:masi$ mdls -name kMDItemContentType test_file.txt
kdItemContentType = (public.plain-text)
18:09:49:masi:masi$ mv test_file.txt test_file.tex
18:10:14:masi:masi$ mdfind osteoporosis | grep /Users/masi/Desktop/masi/
18:10:20:masi:masi$ mdls -name kMDItemContentType test_file.tex
kMDItemContentType = "org.tug.tex"
当前的诊断工具在聊天中的使用和讨论
来自的隐藏命令是否可以在启动服务数据库中查询将打开任意文件或UTI类型的应用程序?
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -dump | grep -n7 org.tug.tex
我们发现MacTeX 2015的TeXShop没有TeX.mdimporter。安装此程序将在以下内容的最后一行给出mdimport -L
:
“ /Applications/TeX/TeXShop.app/Contents/Library/Spotlight/TeX.mdimporter”)
尝试Patrix失败
mkdir -p ~/Library/Spotlight; ln -s /Applications/TeX/TeXShop.app/Contents/Library/Spotlight/TeX.mdimporter ~/Library/Spotlight/
之后,rm ~/Library/Spotlight/TeX.mdimporter
我们通过将HardDisc移至Prevent -panel并快速将其重置来重置Spotlight的索引,因此现在需要一些时间来对系统进行索引。
克拉诺玛斯的答案结果持续了一天直到回到糟糕的状态
我在mdfind中不稳定地获得了一些.tex文件。从该提案的初始使用开始,经过一天的使用,情况又回到了不良状态:
- 骨质疏松症搜索返回的文件与一天前相同,但是我注意到这些文件在搜索中不可见,这些文件最近在搜索匹配中不可见,并且在上次编辑时足够长的时间
- 仅显示最近编辑的文件,有时甚至显示3.5个月大的文件
跑步18:25:06:~:masi$ /usr/bin/mdimport -d3 /Users/masi/Dropbox/Internal\ Diseases/24.9.2015.tex
并获得
(Debug) Import: file:/Users/masi/Dropbox/Internal Diseases/24.9.2015.tex plugin:file://localhost/Library/Spotlight/TeX.mdimporter/ /Library/Spotlight/TeX.mdimporter
(Info) Import: edu.uo.texshop.tex
(Debug) Import: Attributes for file /Users/masi/Dropbox/Internal Diseases/24.9.2015.tex: {
":MD:kMDExtendedImportDictionary" = {
};
"_kMDItemFinderLabel" = 0;
"com_apple_metadata_modtime" = 464803819;
kMDItemContentCreationDate = "2015-09-23 19:57:11 +0000";
kMDItemContentModificationDate = "2015-09-24 16:10:19 +0000";
kMDItemContentType = "edu.uo.texshop.tex";
kMDItemContentTypeTree = (
"edu.uo.texshop.tex",
"public.text",
"public.data",
"public.item",
"public.content",
"public.plain-text",
"org.tug.tex"
);
kMDItemDateAdded = "2015-09-23 19:57:11 +0000";
kMDItemDisplayName = {
"" = "24.9.2015.tex";
};
kMDItemKind = {
"" = "TeX File";
en = "TeX File";
pt = "Documento TeX";
};
kMDItemLogicalSize = 18220;
kMDItemPhysicalSize = 20480;
kMDItemTextContent = "\...";
}
2015-09-24 18:25:50.335 mdimport[6875:707] Imported '/Users/masi/Dropbox/Internal Diseases/24.9.2015.tex' of type 'edu.uo.texshop.tex' with plugIn /Library/Spotlight/TeX.mdimporter.
2015-09-24 18:25:50.336 mdimport[6875:707] Attributes: {
":MD:kMDExtendedImportDictionary" = {
};
"_kMDItemFinderLabel" = 0;
"_kMDItemStaticInterestScore" = "0.5";
"com_apple_metadata_modtime" = 464803819;
kMDItemContentCreationDate = "2015-09-23 19:57:11 +0000";
kMDItemContentModificationDate = "2015-09-24 16:10:19 +0000";
kMDItemContentType = "edu.uo.texshop.tex";
kMDItemContentTypeTree = (
"edu.uo.texshop.tex",
"public.text",
"public.data",
"public.item",
"public.content",
"public.plain-text",
"org.tug.tex"
);
kMDItemDateAdded = "2015-09-23 19:57:11 +0000";
kMDItemDisplayName = {
"" = "24.9.2015.tex";
};
kMDItemKind = {
"" = "TeX File";
en = "TeX File";
pt = "Documento TeX";
};
kMDItemLogicalSize = 18220;
kMDItemPhysicalSize = 20480;
kMDItemTextContent = "\...";
}
猜猜问题的根源:/Volumes/Disc/.Spotlight-V100 / ...
我通过考察了不同时间点的内存动态fdupes -rd /Volumes/Disc2/
,以下示例是在建立索引期间进行的:
[1] /Users/masi/Dropbox/det2/plan.tex
[2] /Volumes/Disc2/.Spotlight-V100/Store-V2/440B4DE1-129F-46AB-9D58-14F473B0282A/Cache/0000/0000/0003/213630.txt
[3] /Volumes/Disc2/.Spotlight-V100/Store-V2/440B4DE1-129F-46AB-9D58-14F473B0282A/Cache/0000/0000/0003/213631.txt
[4] /Volumes/Disc2/.Spotlight-V100/Store-V2/440B4DE1-129F-46AB-9D58-14F473B0282A/Cache/0000/0000/0003/213633.txt
... [10] sometimes much more
---
文件内容是两个空行。您会看到Spotlight为索引创建的许多重复条目。Spotlight的索引在其功能的许多方面都有很多重复项。我还研究了不同媒体的这种行为。在索引编制过程中以及在完成索引编制的稳定期内,创建了许多虚拟文件/重复文件。我认为Apple在设计Spotlight使用的索引方面做得不好。
如何使用mdfind / Spotlight / Finder搜索LaTeX文档?