2

この mdfind クエリを見てください。

mdfind 'kMDItemFSName = "Pages.app" || kMDItemFSName = "Keynote.app" || kMDItemFSName = "Numbers.app"'  

何か問題がありますか?おそらく論理的ですOR- ||Apple のmdfindマニュアルページに記載されていないのはどれですか?

99% のケースで、mdfind各アプリの 3 つのファイル パス/場所を返しますiwork(インストールされていない場合は何も返しません)。

/Applications/iWork '09/Pages.app   
/Applications/iWork '09/Keynote.app  
/Applications/iWork '09/Numbers.app

しかし、〜1〜5%(10.8.2)でこれを取得しますmdfind

/Applications/iWork '09/Keynote.app  
/Applications/Mail.app  
/Applications/Messages.app  
/Applications/Utilities/Migration Assistant.app  
/Applications/Notes.app  
...  
/Library/Scripts/Printing Scripts/Convert To PDF.scpt  
/Library/Scripts/Printing Scripts/Convert To PostScript.scpt  
/Library/Scripts/Printing Scripts/Print Window With Subfolders.scpt  
/Library/Scripts/Printing Scripts/Print Window.scpt  
...  
/System/Library/Frameworks/GameKit.framework/Versions/A/Resources/GKNavbarBackButtonNormalLandscape.png  
/System/Library/Frameworks/GameKit.framework/Versions/A/Resources/GKNavbarBackButtonNormalLandscape@2x.png*  

------------ List goes on (tons of stuff) ------------  

私のmdfindクエリに何か問題がありますか、または何か問題がありSpotlight databaseますか?

確かに可能性: Spotlight には重大なバグがあり10.7.5、アップデートで導入されています ( https://discussions.apple.com/message/19863234#1986323410.8.2を確認してください) 。

ありがとう :-)

4

1 に答える 1

1

ここで何が起こっているのかわかりません。kMDItemFS *でのOR検索でSpotlightが壊れているようです?

FinderでORベースのSpotlight検索を手動で作成しました-失敗します。

HoudahSpotをダウンロードして、単純な「ファイル名」をPages.appにするか、ファイル名をKeynote.appクエリにして、同じ結果(50,000以上)を取得しました。

したがって、mdfindによるクエリの解釈の単なるバグのようには見えません。

さらなる手がかりとして:名前にFSが含まれるアイテム(例:kMDItemFSName)はSpotlightデータベースに保存されないため、クエリにかかる時間が大幅に長くなります。

 mdfind "kMDItemCFBundleIdentifier == 'com.apple.iWork.Pages'  || kMDItemCFBundleIdentifier == 'com.apple.iWork.Keynote'"

私のコンピュータでは約1000倍速く動作します。

5年ほど前のこのガイドでは、単一の| ORの場合ですが、10.8.2では機能しません http://macdevcenter.com/pub/a/mac/2006/01/04/mdfind.html

于 2012-10-17T15:03:35.727 に答える