<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">On 9-8-2014 2:38, Alex Peters wrote:<br>
</div>
<blockquote
cite="mid:CAFdkmpunCNL=jdYCEL_Ks5AqZh=pixt-LWTyDNTyMqVEE1O35w@mail.gmail.com"
type="cite">
<p dir="ltr">Values need to be quoted, I believe. Compare these
two queries:</p>
<p dir="ltr">Content LIKE <a moz-do-not-send="true"
href="http://foo.com">foo.com</a><br>
Content LIKE '<a moz-do-not-send="true" href="http://foo.com">foo.com</a>'</p>
<p dir="ltr">I wonder whether wildcards might be necessary, like
they seem to be in regular SQL:</p>
<p dir="ltr">Content LIKE '%<a moz-do-not-send="true"
href="http://foo.com">foo.com</a>%'</p>
<div class="gmail_quote">On 09/08/2014 12:36 am, "Jeff Blaine"
<<a moz-do-not-send="true" href="mailto:jblaine@kickflop.net">jblaine@kickflop.net</a>>
wrote:<br type="attribution">
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
Setup: RT 4.2.5 with PostgreSQL and full-text indexing enabled<br>
and completed for all tickets. Tickets 1, 2, and 3 all have<br>
contents with the string <a moz-do-not-send="true"
href="http://foo.com" target="_blank">foo.com</a><br>
<br>
Searching for 'content LIKE <a moz-do-not-send="true"
href="http://foo.com" target="_blank">foo.com</a>' returns
tickets 1, 2, 3<br>
<br>
Searching for 'content NOT LIKE <a moz-do-not-send="true"
href="http://foo.com" target="_blank">foo.com</a>' returns
tickets 1, 2, 3<br>
<br>
Has anyone seen this? Any ideas what might be going wrong or
how<br>
do start debugging this?<br>
<br>
</blockquote>
</div>
<br>
</blockquote>
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.<br>
<br>
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') ) ) ;<br>
<br>
Seems the last AND should really be a AND NOT.<br>
<br>
In the past SearchBuilder always pre and postpended % around search
terms. Not sure if it still does but I think so.<br>
<br>
Joop<br>
<br>
</body>
</html>