• 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: Create and Query Multiple Values in an attribute
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Create and Query Multiple Values in an attribute


  • Subject: Re: Create and Query Multiple Values in an attribute
  • From: "Jerry W. Walker" <email@hidden>
  • Date: Tue, 13 Mar 2007 06:24:10 -0400

Hi, Ian,

On Mar 13, 2007, at 4:25 AM, email@hidden wrote:

Once again thanks Jerry,

I've been thinking about the original code that you so kindly created for
me. I have a few questions relating to that.


Firstly, I have made it do what I want to do by changing it slightly:

qualifiers.addObject(EOQualifier.qualifierWithQualifierFormat ("recordField
= %s", new NSArray(aSearchField));
qualifiers.addObject(EOQualifier.qualifierWithQualifierFormat ("anotherRecordField
= %s", new NSArray(aSearchField));
}


so that if a few other attributes for alternative names are added to the
database, it searches those too (in an OR type fashion). Seems to work OK,
but at the moment it just System.out.printlns the number of records in the
returnedResults array, so I need to figure out how to get the array to
populate my WORepetition.

I'm not sure quite what to suggest here other than that the array returned from the fetch is bound to the "list" binding of the WORepetition and an arbitrary variable of the same type as an element of the array is bound to the "item" attribute.


I'm not sure why, but:

qualifiers.addObject(EOQualifier.qualifierWithQualifierFormat ("recordField
= %s OR anotherRecordField = %s", new NSArray(aSearchField));


Doesn't work. I thought it should, having looked at the EnterpriseObjects
pdf (page 73).

Try qualifiers.addObject(EOQualifier.qualifierWithQualifierFormat ("recordField = %s OR anotherRecordField = %s", new NSArray(new Object [] {aSearchField, aSearchField}));


Since you have two references in the "QualifierFormat", then you need to supply two values in the array.

Lastly, thank you for pointing out the wirehose thing. I'll have a proper
look at that in due course.

It's certainly worth a look.

Regards,
Jerry

Ian.

On Mon, March 12, 2007 10:15 am, Jerry W. Walker wrote:
Hi, Ian,

What you're trying to do is much more sophisticated than what is
being done by the code I sent you. I worked on an application a couple
years ago with similar requirements for searching for pictures. In order
to meet those requirements, we integrated Gary Teter's WireHose frameworks
and, using them, created an index of pictures with keywords for each
picture.


http://www.wirehose.com/

Wirehose is offered for free and has some sophisticated searching and
indexing built in that, if you use, could save you a few weeks of
programming. Your end result would probably have a higher quality as well,
since Teter's code has gone through a few generations of optimization by
one of the WO masters.


I hope you've provided some lengthy estimates to your users, because
this is not a quickly solved problem. Searching is an inherently difficult
problem space.


Regards,
Jerry

-- MacMail - the Webmail service especially for Mac users worldwide http://www.macmail.com


--
__ Jerry W. Walker,
WebObjects Developer/Instructor for High Performance Industrial Strength Internet Enabled Systems


    email@hidden
    203 278-4085        office



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Create and Query Multiple Values in an attribute
      • From: email@hidden
References: 
 >Re: Create and Query Multiple Values in an attribute (From: email@hidden)

  • Prev by Date: Re: Create and Query Multiple Values in an attribute
  • Next by Date: Re: Error loading Model framework in deployment
  • Previous by thread: Re: Create and Query Multiple Values in an attribute
  • Next by thread: Re: Create and Query Multiple Values in an attribute
  • Index(es):
    • Date
    • Thread