<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Full Text Search on Heroku</title>
	<atom:link href="http://tenderlovemaking.com/2009/10/17/full-text-search-on-heroku/feed/" rel="self" type="application/rss+xml" />
	<link>http://tenderlovemaking.com/2009/10/17/full-text-search-on-heroku/</link>
	<description>The act of making love, tenderly.</description>
	<lastBuildDate>Wed, 08 Feb 2012 20:38:58 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Giles Bowkett</title>
		<link>http://tenderlovemaking.com/2009/10/17/full-text-search-on-heroku/comment-page-1/#comment-138723</link>
		<dc:creator>Giles Bowkett</dc:creator>
		<pubDate>Thu, 14 Jul 2011 07:10:21 +0000</pubDate>
		<guid isPermaLink="false">http://tenderlovemaking.com/?p=369#comment-138723</guid>
		<description>@Matthew - have you tried ActiveRecord::Base.connection.execute &quot;EXPLAIN ANALYZE;&quot;? You may be able to get Postgres to do anything you want with that through the Heroku console.

@Aaron - just found out about this project after creating my own (linked via my name) which is based on Xavier Shay&#039;s PeepCode. Going to dig into this tomorrow, can&#039;t wait.</description>
		<content:encoded><![CDATA[<p>@Matthew &#8211; have you tried ActiveRecord::Base.connection.execute &#8220;EXPLAIN ANALYZE;&#8221;? You may be able to get Postgres to do anything you want with that through the Heroku console.</p>
<p>@Aaron &#8211; just found out about this project after creating my own (linked via my name) which is based on Xavier Shay&#8217;s PeepCode. Going to dig into this tomorrow, can&#8217;t wait.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matthew O'Riordan</title>
		<link>http://tenderlovemaking.com/2009/10/17/full-text-search-on-heroku/comment-page-1/#comment-135477</link>
		<dc:creator>Matthew O'Riordan</dc:creator>
		<pubDate>Wed, 11 May 2011 23:38:00 +0000</pubDate>
		<guid isPermaLink="false">http://tenderlovemaking.com/?p=369#comment-135477</guid>
		<description>Hi guys

I have set up texticle on my Heroku app which uses a shared database, and I am finding that the full text search speeds are abominable.  When I run a search locally over around 300k rows, I get response times of 10ms or so.  Simple search such as Place.search(&#039;London&#039;)

However, when I run the search on Heroku the search is taking 3,000ms or so.  I suspect this is because the full text index is in fact not created on the server, so perhaps Heroku don&#039;t support this and Postgres is simply doing a table scan and converting the text using the to_tsvector method.  As Heroku does not allow me direct SQL access to the server, I&#039;m not really sure how I can confirm this (I would use EXPLAIN ANALYZE).

Has anyone got full text indexing working on Heroku for sure i.e. have you tested the performance?

Matt</description>
		<content:encoded><![CDATA[<p>Hi guys</p>
<p>I have set up texticle on my Heroku app which uses a shared database, and I am finding that the full text search speeds are abominable.  When I run a search locally over around 300k rows, I get response times of 10ms or so.  Simple search such as Place.search(&#8216;London&#8217;)</p>
<p>However, when I run the search on Heroku the search is taking 3,000ms or so.  I suspect this is because the full text index is in fact not created on the server, so perhaps Heroku don&#8217;t support this and Postgres is simply doing a table scan and converting the text using the to_tsvector method.  As Heroku does not allow me direct SQL access to the server, I&#8217;m not really sure how I can confirm this (I would use EXPLAIN ANALYZE).</p>
<p>Has anyone got full text indexing working on Heroku for sure i.e. have you tested the performance?</p>
<p>Matt</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kevin Ansfield</title>
		<link>http://tenderlovemaking.com/2009/10/17/full-text-search-on-heroku/comment-page-1/#comment-133687</link>
		<dc:creator>Kevin Ansfield</dc:creator>
		<pubDate>Wed, 30 Mar 2011 00:15:53 +0000</pubDate>
		<guid isPermaLink="false">http://tenderlovemaking.com/?p=369#comment-133687</guid>
		<description>To the people talking about schema.rb issues the solution is to tell rails to use sql dumps instead. Ryan Bates covers this in his Postgres sceencast over on Peepcode - http://peepcode.com/products/postgresql</description>
		<content:encoded><![CDATA[<p>To the people talking about schema.rb issues the solution is to tell rails to use sql dumps instead. Ryan Bates covers this in his Postgres sceencast over on Peepcode &#8211; <a href="http://peepcode.com/products/postgresql" rel="nofollow">http://peepcode.com/products/postgresql</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Julian Cox</title>
		<link>http://tenderlovemaking.com/2009/10/17/full-text-search-on-heroku/comment-page-1/#comment-132157</link>
		<dc:creator>Julian Cox</dc:creator>
		<pubDate>Wed, 02 Mar 2011 00:38:47 +0000</pubDate>
		<guid isPermaLink="false">http://tenderlovemaking.com/?p=369#comment-132157</guid>
		<description>Cool plugin - thanks for posting.  Just FYI if you try and include a related table in a chained find call the search will fail with rank column not exisiting eg:

SELECT &quot;events&quot;.&quot;id&quot; AS t0_r0, &quot;events&quot;.&quot;title&quot; AS t0_r1, &quot;events&quot;.&quot;description&quot; AS t0_r2, &quot;events&quot;.&quot;location&quot; AS t0_r3, &quot;events&quot;.&quot;date_and_time&quot; AS t0_r4, &quot;events&quot;.&quot;contact_email&quot; AS t0_r5, &quot;events&quot;.&quot;url&quot; AS t0_r6, &quot;events&quot;.&quot;lat&quot; AS t0_r7, &quot;events&quot;.&quot;lng&quot; AS t0_r8, &quot;events&quot;.&quot;created_at&quot; AS t0_r9, &quot;events&quot;.&quot;updated_at&quot; AS t0_r10, &quot;events&quot;.&quot;price&quot; AS t0_r11, &quot;events&quot;.&quot;source_url&quot; AS t0_r12, &quot;events&quot;.&quot;referer_url&quot; AS t0_r13, &quot;events&quot;.&quot;guid&quot; AS t0_r14, &quot;tags&quot;.&quot;id&quot; AS t1_r0, &quot;tags&quot;.&quot;name&quot; AS t1_r1 FROM &quot;events&quot;  LEFT OUTER JOIN &quot;taggings&quot; ON (&quot;events&quot;.&quot;id&quot; = &quot;taggings&quot;.&quot;taggable_id&quot; AND &quot;taggings&quot;.&quot;taggable_type&quot; = &#039;Event&#039;)  LEFT OUTER JOIN &quot;tags&quot; ON (&quot;tags&quot;.&quot;id&quot; = &quot;taggings&quot;.&quot;tag_id&quot;) AND taggings.tagger_id IS NULL AND taggings.context = &#039;tags&#039;   WHERE ((events.lat&gt;-44.8291028702835 AND events.lat&lt;-27.9804699988679 AND (events.lng164.220125))) AND (((to_tsvector(&#039;english&#039;, coalesce(&quot;events&quot;.&quot;title&quot;, &#039;&#039;) &#124;&#124; &#039; &#039; &#124;&#124; coalesce(&quot;events&quot;.&quot;description&quot;, &#039;&#039;)) @@ to_tsquery(&#039;&#039;&#039;tri&#039;&#039;&#039;)) AND (events.id IN (SELECT taggings.taggable_id FROM taggings JOIN tags ON taggings.tag_id = tags.id AND (tags.name LIKE &#039;music&#039;) WHERE taggings.taggable_type = &#039;Event&#039;))) AND (date_and_time &gt;= &#039;2011-02-27 00:00:00.000000&#039; and date_and_time &lt; &#039;2011-04-03 00:00:00.000000&#039;))  ORDER BY rank DESC

ActiveRecord::StatementInvalid (PGError: ERROR:  column &quot;rank&quot; does not exist
LINE 1: ...nd_time &lt; &#039;2011-04-03 00:00:00.000000&#039;))  ORDER BY rank DESC

Cheers,
Julian.</description>
		<content:encoded><![CDATA[<p>Cool plugin &#8211; thanks for posting.  Just FYI if you try and include a related table in a chained find call the search will fail with rank column not exisiting eg:</p>
<p>SELECT &#8220;events&#8221;.&#8221;id&#8221; AS t0_r0, &#8220;events&#8221;.&#8221;title&#8221; AS t0_r1, &#8220;events&#8221;.&#8221;description&#8221; AS t0_r2, &#8220;events&#8221;.&#8221;location&#8221; AS t0_r3, &#8220;events&#8221;.&#8221;date_and_time&#8221; AS t0_r4, &#8220;events&#8221;.&#8221;contact_email&#8221; AS t0_r5, &#8220;events&#8221;.&#8221;url&#8221; AS t0_r6, &#8220;events&#8221;.&#8221;lat&#8221; AS t0_r7, &#8220;events&#8221;.&#8221;lng&#8221; AS t0_r8, &#8220;events&#8221;.&#8221;created_at&#8221; AS t0_r9, &#8220;events&#8221;.&#8221;updated_at&#8221; AS t0_r10, &#8220;events&#8221;.&#8221;price&#8221; AS t0_r11, &#8220;events&#8221;.&#8221;source_url&#8221; AS t0_r12, &#8220;events&#8221;.&#8221;referer_url&#8221; AS t0_r13, &#8220;events&#8221;.&#8221;guid&#8221; AS t0_r14, &#8220;tags&#8221;.&#8221;id&#8221; AS t1_r0, &#8220;tags&#8221;.&#8221;name&#8221; AS t1_r1 FROM &#8220;events&#8221;  LEFT OUTER JOIN &#8220;taggings&#8221; ON (&#8220;events&#8221;.&#8221;id&#8221; = &#8220;taggings&#8221;.&#8221;taggable_id&#8221; AND &#8220;taggings&#8221;.&#8221;taggable_type&#8221; = &#8216;Event&#8217;)  LEFT OUTER JOIN &#8220;tags&#8221; ON (&#8220;tags&#8221;.&#8221;id&#8221; = &#8220;taggings&#8221;.&#8221;tag_id&#8221;) AND taggings.tagger_id IS NULL AND taggings.context = &#8216;tags&#8217;   WHERE ((events.lat&gt;-44.8291028702835 AND events.lat&lt;-27.9804699988679 AND (events.lng164.220125))) AND (((to_tsvector(&#8216;english&#8217;, coalesce(&#8220;events&#8221;.&#8221;title&#8221;, &#8221;) || &#8216; &#8216; || coalesce(&#8220;events&#8221;.&#8221;description&#8221;, &#8221;)) @@ to_tsquery(&#8221;&#8217;tri&#8221;&#8217;)) AND (events.id IN (SELECT taggings.taggable_id FROM taggings JOIN tags ON taggings.tag_id = tags.id AND (tags.name LIKE &#8216;music&#8217;) WHERE taggings.taggable_type = &#8216;Event&#8217;))) AND (date_and_time &gt;= &#8217;2011-02-27 00:00:00.000000&#8242; and date_and_time &lt; &#039;2011-04-03 00:00:00.000000&#039;))  ORDER BY rank DESC</p>
<p>ActiveRecord::StatementInvalid (PGError: ERROR:  column &quot;rank&quot; does not exist<br />
LINE 1: &#8230;nd_time &lt; &#039;2011-04-03 00:00:00.000000&#039;))  ORDER BY rank DESC</p>
<p>Cheers,<br />
Julian.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ken Mayer</title>
		<link>http://tenderlovemaking.com/2009/10/17/full-text-search-on-heroku/comment-page-1/#comment-116883</link>
		<dc:creator>Ken Mayer</dc:creator>
		<pubDate>Sat, 19 Jun 2010 02:31:48 +0000</pubDate>
		<guid isPermaLink="false">http://tenderlovemaking.com/?p=369#comment-116883</guid>
		<description>Has anyone figured out a way to fix the broken schema.rb issues? (Other than manually commenting out the offending lines?)</description>
		<content:encoded><![CDATA[<p>Has anyone figured out a way to fix the broken schema.rb issues? (Other than manually commenting out the offending lines?)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Levi Cook</title>
		<link>http://tenderlovemaking.com/2009/10/17/full-text-search-on-heroku/comment-page-1/#comment-113907</link>
		<dc:creator>Levi Cook</dc:creator>
		<pubDate>Mon, 26 Apr 2010 01:19:44 +0000</pubDate>
		<guid isPermaLink="false">http://tenderlovemaking.com/?p=369#comment-113907</guid>
		<description>Nice idea.

Just an FYI. I ran into a bug that occurs when multiple indexes are defined on the same model. I haven&#039;t quite figured out why it&#039;s failing. I have some &quot;integration&quot; tests that demonstrate the problem. If anyone&#039;s interested, it lives on a fork here: http://github.com/levicook/texticle/tree/

Thanks!</description>
		<content:encoded><![CDATA[<p>Nice idea.</p>
<p>Just an FYI. I ran into a bug that occurs when multiple indexes are defined on the same model. I haven&#8217;t quite figured out why it&#8217;s failing. I have some &#8220;integration&#8221; tests that demonstrate the problem. If anyone&#8217;s interested, it lives on a fork here: <a href="http://github.com/levicook/texticle/tree/" rel="nofollow">http://github.com/levicook/texticle/tree/</a></p>
<p>Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sam</title>
		<link>http://tenderlovemaking.com/2009/10/17/full-text-search-on-heroku/comment-page-1/#comment-112237</link>
		<dc:creator>sam</dc:creator>
		<pubDate>Wed, 24 Mar 2010 21:25:44 +0000</pubDate>
		<guid isPermaLink="false">http://tenderlovemaking.com/?p=369#comment-112237</guid>
		<description>What about multi model searching? I need to be able to search for contact information on a Customer model that has_many Contacts. Is that possible?</description>
		<content:encoded><![CDATA[<p>What about multi model searching? I need to be able to search for contact information on a Customer model that has_many Contacts. Is that possible?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sausheong</title>
		<link>http://tenderlovemaking.com/2009/10/17/full-text-search-on-heroku/comment-page-1/#comment-110821</link>
		<dc:creator>sausheong</dc:creator>
		<pubDate>Sat, 27 Feb 2010 13:09:22 +0000</pubDate>
		<guid isPermaLink="false">http://tenderlovemaking.com/?p=369#comment-110821</guid>
		<description>Nice! I was wondering if this works with something other than ActiveRecord, for example does it work with DataMapper?</description>
		<content:encoded><![CDATA[<p>Nice! I was wondering if this works with something other than ActiveRecord, for example does it work with DataMapper?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: William</title>
		<link>http://tenderlovemaking.com/2009/10/17/full-text-search-on-heroku/comment-page-1/#comment-109806</link>
		<dc:creator>William</dc:creator>
		<pubDate>Wed, 10 Feb 2010 09:11:57 +0000</pubDate>
		<guid isPermaLink="false">http://tenderlovemaking.com/?p=369#comment-109806</guid>
		<description>I get the same error as &quot;dud3&quot; above, but with the model name &quot;Address&quot; instead of what I assume is &quot;Business&quot;. It seems there&#039;s something that doesn&#039;t like class names that end in two &quot;s&quot;es. 

I get:
rake aborted!
uninitialized constant Addres

Any ideas?</description>
		<content:encoded><![CDATA[<p>I get the same error as &#8220;dud3&#8243; above, but with the model name &#8220;Address&#8221; instead of what I assume is &#8220;Business&#8221;. It seems there&#8217;s something that doesn&#8217;t like class names that end in two &#8220;s&#8221;es. </p>
<p>I get:<br />
rake aborted!<br />
uninitialized constant Addres</p>
<p>Any ideas?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mtraven</title>
		<link>http://tenderlovemaking.com/2009/10/17/full-text-search-on-heroku/comment-page-1/#comment-109677</link>
		<dc:creator>mtraven</dc:creator>
		<pubDate>Sun, 07 Feb 2010 17:32:24 +0000</pubDate>
		<guid isPermaLink="false">http://tenderlovemaking.com/?p=369#comment-109677</guid>
		<description>I&#039;m having my own problem:  the migration generates but doesn&#039;t run successfully:

mt@laptop /misc/sourceforge/oscurrency$ heroku rake db:migrate
rake aborted!
PGError: ERROR:  invalid input syntax for integer: &quot;&quot;:
                 CREATE index communications_fts_idx
        ON communications
        USING gin((to_tsvector(&#039;english&#039;, coalesce(communications.subject, &#039;&#039;) &#124;&#124; &#039; &#039; &#124;&#124; coalesce(communications.content, &#039;&#039;) &#124;&#124; &#039; &#039; &#124;&#124; coalesce(communications.recipient_id, &#039;&#039;))))

Hm, it this is for a class that is not indexed.  It looks like another problem in the rake task.  Deleting the code for this class fixed the problem.</description>
		<content:encoded><![CDATA[<p>I&#8217;m having my own problem:  the migration generates but doesn&#8217;t run successfully:</p>
<p>mt@laptop /misc/sourceforge/oscurrency$ heroku rake db:migrate<br />
rake aborted!<br />
PGError: ERROR:  invalid input syntax for integer: &#8220;&#8221;:<br />
                 CREATE index communications_fts_idx<br />
        ON communications<br />
        USING gin((to_tsvector(&#8216;english&#8217;, coalesce(communications.subject, &#8221;) || &#8216; &#8216; || coalesce(communications.content, &#8221;) || &#8216; &#8216; || coalesce(communications.recipient_id, &#8221;))))</p>
<p>Hm, it this is for a class that is not indexed.  It looks like another problem in the rake task.  Deleting the code for this class fixed the problem.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

