Re: Searching Question
Re: Searching Question
- Subject: Re: Searching Question
- From: Chuck Hill <email@hidden>
- Date: Fri, 2 Oct 2009 15:41:03 -0700
On Oct 2, 2009, at 2:27 PM, Don Lindsay wrote:
Hello;
I know I have asked many questions this week. :) This is the first
time I have attempted a search of this magnitude in WebObjects. I
have users who are able to specify a parameter. For instance the
gauge of a steel pipe (.357), I want them to be able to enter a
default variance (.010) to apply to any query they run and be able
to return the results ( would end up as between .347 and .357.)
I can use QueryMin and QueryMax and java code, but that seems not
very WOish (requires too much work and WO typically doesnt require
alot of work).
The query would be run against thousands to millions of records and
return matching items. Presenting the user with items that fall
within their variance when they login to the application (and
display them 10 at a time using a WORepetition).
Querying millions of records on each login might present a performance
problem regardless of how you do it. You may want to consider caching
this or only doing it on demand. A regular WODisplayGroup may kill
your app if there are lots of matches. In that case,
ERXBatchingDisplayGroup from Wonder is what you want to be using.
I know how to do this in SQL, but would prefer to use the WebObjects
methodology to accomplish this goal. Any ideas or suggestions?
How are you setting up your display groups now? When I use them, I
usually do it in code. You can just make a qualifier like:
EOQualifier guageInRange = new EOAndQualifier(
new NSArray(EOQualifier[]{
new EOKeyValueQualifier("guage",
EOQualifier.QualifierOperatorGreaterThanOrEqualTo, target - variance),
new EOKeyValueQualifier("guage",
EOQualifier.QualifierOperatorLessThanOrEqualTo, target | variance),
});
Or, if you are using Wonder's ERXQ, write the same thing with a lot
less typing:
EOQualifier guageInRange = ERXQ.and(ERXQ.greaterThanOrEqualTo("guage",
target - variance), lessThanOrEqualTo("guage", target | variance));
Chuck
--
Chuck Hill Senior Consultant / VP Development
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve specific
problems.
http://www.global-village.net/products/practical_webobjects
_______________________________________________
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