[rt-users] 'content matches' and 'content doesn't match' give same results

Joop jvdwege at xs4all.nl
Sat Aug 9 06:07:59 EDT 2014


On 9-8-2014 11:57, Joop wrote:
>
> I ran  a search with StatementLogging enabled and this is the sql
> statement with "content not like 'foo.com'" and "content like
> 'foo.com'", they are the same.
>
> SELECT COUNT(DISTINCT main.id) FROM Tickets main JOIN Transactions
> Transactions_1  ON ( Transactions_1.ObjectType = 'RT::Ticket' ) AND (
> Transactions_1.ObjectId = main.id ) JOIN Attachments Attachments_2  ON
> ( Attachments_2.TransactionId = Transactions_1.id )  WHERE
> (main.IsMerged IS NULL) AND (main.Status != 'deleted') AND (main.Type
> = 'ticket') AND ( ( Attachments_2.ContentIndex @@
> plainto_tsquery('foo.com') ) ) ;
>
> Seems the last AND should really be a AND NOT.
>
> In the past SearchBuilder always pre and postpended % around search
> terms. Not sure if it still does but I think so.
>
> Joop
This was on rt-4.0.21 and rt-4.2.26, Searchbuilder-1.59 and 1.65
respectively

Joop

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20140809/cab53e46/attachment.htm>


More information about the rt-users mailing list