[rt-devel] help me, please....

AJ rt at musefoundry.com
Wed Jan 14 01:17:17 EST 2004


I have modified RTFM to people can email word docs or whetever and they get
added to/updated and served up by RTFM. However , this is just not good
enough for my boss.. 
 
I need to simplify the search.  One field to fill in that searches all the
relevant custom fields in the classes.  I am thinking that the air at the
top of the corporate ladder must be very thin if a few extra fields can
confuse someone like that. 
 
I created a quicksearch page with this init code:
my @SEARCH=split(/\s/,$ARGS{'SearchAll'});
my @EXAMPLE=qw(fred wilma); #hard coded array of search terms because I am
tired of putting them in all the time
my $articles = RT::FM::ArticleCollection->new( $session{'CurrentUser'});
$articles->LimitToCustomFieldValue( OPERATOR=> 'LIKE', ENTRYAGGREGATOR =>
'OR', VALUE=>\@EXAMPLE );
 
The query it generates, no matter what the ENTRYAGGREGATOR is, can be seen
below.  A perfectly good query if only that last AND was an OR. 
 
SELECT count(DISTINCT main.id) FROM ( ( FM_Articles main LEFT JOIN
FM_ArticleCFValues as FM_ArticleCFValues_1  ON  ( main.id =
FM_ArticleCFValues_1.Article)) LEFT JOIN FM_ArticleCFValues as
FM_ArticleCFValues_2  ON  ( main.id = FM_ArticleCFValues_2.Article))  WHERE
((FM_ArticleCFValues_1.Content LIKE '%fred%')) AND
((FM_ArticleCFValues_2.Content LIKE '%wilma%'))
 
I need to know what I am doing wrong. I dug into the DBIx module code and it
looks like the left joins and whereclauses may be hard coded to 'AND' in
some instances..  I am thinking there is another way to do this with Limit
but am unsure.  
Thank you..
AJ
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://pallas.eruditorum.org/pipermail/rt-devel/attachments/20040114/ebe4d0f6/attachment.html


More information about the Rt-devel mailing list