RTFM search through body text 2.2.0RC5

Hi,

I’ve newly installed RT 3.6.3 and RTFM 2.2.0RC5. I created a custom field
for the Article’s body. The field name is called body and the type is a
wikitext area. Then I created a new class and added the body field to that
class. I setup the permissions so that I have full access to the class.

I went ahead and created a new article in the class. Then when I go to the
advanced search and try and search for a word that is in the body field it
doesn’t return any results. I did some searching on the mailing list archive
and have seen others with a similar problem but no answer yet.

I have tried installing older versions of RTFM to see if they have the same
problems. I installed ver 2.1.40 and that had the same problem. Then I went
all the way back to the latest final release of RTFM ver 2.0.4. This one
actually does work. The only issue is that it is soooo old that it doesn’t
really fit in well with 3.6.3 and there is a bunch of functionality missing.

Please someone help me.

Thanks,

-Jeff

This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

Jeff Platter wrote:

Hi,

I�ve newly installed RT 3.6.3 and RTFM 2.2.0RC5. I created a custom
field for the Article�s body. The field name is called body and the type
is a wikitext area. Then I created a new class and added the body field
to that class. I setup the permissions so that I have full access to the
class.

I went ahead and created a new article in the class. Then when I go to
the advanced search and try and search for a word that is in the body
field it doesn�t return any results. I did some searching on the mailing
list archive and have seen others with a similar problem but no answer yet.

Strange since I have a setup like this and this is the query thats
generated:
/* Formatted on 2007/06/07 10:09 (Formatter Plus v4.8.8) */
SELECT COUNT (DISTINCT main.ID)
FROM (fm_articles main LEFT JOIN objectcustomfieldvalues
objectcustomfieldvalues_1
ON ((objectcustomfieldvalues_1.disabled = ‘0’))
AND (objectcustomfieldvalues_1.objectid = main.ID))
WHERE ((LOWER (main.CLASS) = ‘1’))
AND ( (objectcustomfieldvalues_1.content LIKE ‘blablabla’)
OR (LOWER (main.NAME) LIKE ‘blablabla’)
OR (LOWER (main.summary) LIKE ‘blablabla’)
)

One thing to notice about this is that we have a modification which
doesn’t add the % when searching for ‘contains’ which translates to the
sql statement LIKE which needs it. Fixing this and running the query by
hand gives me the expected result of: 0 results :wink:
Entering something which I know is available gives me the expected
result though.
One thing to be notice is that there are 2 content columns in the
Objectcustomfieldvalues table namely:
content and largecontent
If it the text does’t fit into content it is placed into largecontent
BUT that column is not included in the search which might explain why
you don’t find what you’re looking for.

Greetings,

Joop

So I finally think I fixed the issue. If anyone is interested it seemed that
in the ArticleCollection_Overlay.pm file there was a select statement that
had 2 things wrong with it. It was generating the JOIN with OR’s instead of
AND’s and it was only searching through the Content field of the
ObjectCustomFieldValues table and not searching through the Largecontent
field as well.

I changed the JOIN criteria to an AND and i added in the Largecontent field
as well to the WHERE clause. This seems to have fixed the problem for me at
the moment. I have a patch file available if anyone else is having this
problem and would like to take a look at the file and try it out.

Here is the patch I wrote:

Patch for getting Custom field searches working in RTFM 2.2.0RC5

File location is /opt/rt3/local/lib/RT/FM/ArticleCollection_Overlay.pm

— ArticleCollection_Overlay.pm 2007-06-07 13:33:19.000000000 -0400

+++ jp_ArticleCollection_Overlay.pm.bak 2007-06-07 13:32:32.000000000 -0400

@@ -254,7 +254,7 @@

         $self->Limit( LEFTJOIN        => $ObjectValuesAlias,

                       FIELD           => 'CustomField',

                       VALUE           => $args{'FIELD'},
  •                      ENTRYAGGREGATOR => 'OR');
    
  •                      ENTRYAGGREGATOR => 'AND');
    
           # Could convert the above to a non-left join and also enable
    

the thing below

         # $self->SUPER::Limit( ALIAS           => $ObjectValuesAlias,

         #                      FIELD           => 'CustomField',

@@ -323,6 +323,15 @@

 else {

     $self->SUPER::Limit(

         ALIAS           => $ObjectValuesAlias,
  •        FIELD           => 'Largecontent',
    
  •        OPERATOR        => $args{'OPERATOR'},
    
  •        VALUE           => $value,
    
  •        QUOTEVALUE      => $args{'QUOTEVALUE'},
    
  •        ENTRYAGGREGATOR => $args{'ENTRYAGGREGATOR'},
    
  •        SUBCLAUSE       => $clause,
    
  •    );
    
  •    $self->SUPER::Limit(
    
  •        ALIAS           => $ObjectValuesAlias,
    
           FIELD           => 'Content',
    
           OPERATOR        => $args{'OPERATOR'},
    
           VALUE           => $value,
    

Thanks to everyone that helped me find this,

-JeffFrom: rt-users-bounces@lists.bestpractical.com
[mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Jeff Platter
Sent: Wednesday, June 06, 2007 6:05 PM
To: rt-users@lists.bestpractical.com
Subject: [FILTER] [rt-users] RTFM search through body text 2.2.0RC5

Hi,

I’ve newly installed RT 3.6.3 and RTFM 2.2.0RC5. I created a custom field
for the Article’s body. The field name is called body and the type is a
wikitext area. Then I created a new class and added the body field to that
class. I setup the permissions so that I have full access to the class.

I went ahead and created a new article in the class. Then when I go to the
advanced search and try and search for a word that is in the body field it
doesn’t return any results. I did some searching on the mailing list archive
and have seen others with a similar problem but no answer yet.

I have tried installing older versions of RTFM to see if they have the same
problems. I installed ver 2.1.40 and that had the same problem. Then I went
all the way back to the latest final release of RTFM ver 2.0.4. This one
actually does work. The only issue is that it is soooo old that it doesn’t
really fit in well with 3.6.3 and there is a bunch of functionality missing.

Please someone help me.

Thanks,

-Jeff

This message has been scanned for viruses and
dangerous content by http://www.mailscanner.info/ MailScanner, and is
believed to be clean.

This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

So I finally think I fixed the issue. If anyone is interested it
seemed that in the ArticleCollection_Overlay.pm file there was a
select statement that had 2 things wrong with it. It was generating
the JOIN with OR’s instead of AND’s and it was only searching
through the Content field of the ObjectCustomFieldValues table and
not searching through the Largecontent field as well.

Hi Jeff

I’ve applied the LargeContent portion of this in SVN.
I’m not sure I’m seeing the bug that caused you to change the
ENTRYAGGREGATOR. Can you tell me
more about what that fix was for?

Thanks

-kevin