• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSPredicate: To be, or not to be
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSPredicate: To be, or not to be


  • Subject: Re: NSPredicate: To be, or not to be
  • From: Jason Wiggins <email@hidden>
  • Date: Wed, 4 Jun 2008 00:27:19 +1000

Not to be...
I asked this very question of Dominic Giampaolo at last years WWDC as I was running into the same issues with exact phrase searches. I asked if this was now possible in Leopard since I was getting results that contained all the requested words, but not necessarily in their correct order. He stated that in Leopard that it is possible to do exact phrase searches as the Text Contents database had been changed and now this was possible. Unfortunately this is not possible under Tiger as I was told during the same question.


JJ

On 03/06/2008, at 7:23 PM, Gerriet M. Denkmann wrote:


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

On Tue, Jun 3, 2008 at 1:37 AM, Gerriet M. Denkmann
<email@hidden> 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 \"%@\"")

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 \"%@\""; or:
predicateFormatContent = @"kMDItemTextContent like \'%@\'"; 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 (email@hidden)

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:
This email sent to email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
This email sent to email@hidden


References: 
 >Re: NSPredicate: To be, or not to be (From: "Gerriet M. Denkmann" <email@hidden>)
 >Re: NSPredicate: To be, or not to be (From: "stephen joseph butler" <email@hidden>)
 >Re: NSPredicate: To be, or not to be (From: "Gerriet M. Denkmann" <email@hidden>)
 >Re: NSPredicate: To be, or not to be (From: "Hamish Allan" <email@hidden>)
 >Re: NSPredicate: To be, or not to be (From: "Gerriet M. Denkmann" <email@hidden>)

  • Prev by Date: Re: CoreData file format stability
  • Next by Date: Re: Hillegass book memory question
  • Previous by thread: Re: NSPredicate: To be, or not to be
  • Next by thread: Re: NSPredicate: To be, or not to be
  • Index(es):
    • Date
    • Thread