On 3 Jun 2008, at 15:33, Hamish Allan wrote:

On Tue, Jun 3, 2008 at 1:37 AM, Gerriet M. Denkmann
<[EMAIL PROTECTED]> wrote:

This one also works for me. Only it kind of works too well, finding
thousands of files.

Another example: <kMDItemTextContent LIKE "Briggel Braggel"> finds
".../Test.txt" which only contains the line: "Briggel and Braggel" .
But I really want only files which contain "Briggel Braggel" or "the Briggel
Braggel of today".

Are you using Tiger?
Yes, I am.

Spotlight indexes on words in Tiger; phrase
indexing began in Leopard -- the phrase must be enclosed within
quotation marks, IIRC (i.e. @"%K LIKE \"[EMAIL PROTECTED]"")

string = <Briggel Braggel> (without the "<>")
predicateFormatContent = @"kMDItemTextContent like %@";
predicate = <kMDItemTextContent LIKE "Briggel Braggel">
finds "Briggel and Braggel". Bad

string = <"Briggel Braggel"> (Note:  " part of string)
predicateFormatContent = @"kMDItemTextContent like %@";
predicate = <kMDItemTextContent LIKE "\"Briggel Braggel\"">
also finds "Briggel and Braggel". Bad

string = anything
predicateFormatContent = @"kMDItemTextContent like \"[EMAIL PROTECTED]"";   or:
predicateFormatContent = @"kMDItemTextContent like \'[EMAIL PROTECTED]'";     
or:
predicateFormatContent = @"kMDItemTextContent like '%@'";     
predicate = <kMDItemTextContent LIKE "%@">
finds nothing. Also not good. (There are lots of files containing %@ though).

string = <'Briggel Braggel'> (Note:  ' part of string)
predicateFormatContent = @"kMDItemTextContent like %@";
predicate = <kMDItemTextContent LIKE "'Briggel Braggel'">
finds nothing. Still bad.

Now I do not have any more ideas.
Anyone else? Finding a string containing blanks on Tiger?

Kind regards,

Gerriet.

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to