<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Rubynaut: First step with Ferret</title>
    <link>http://www.rubynaut.net/articles/2007/04/08/first-step-with-ferret</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description></description>
    <item>
      <title>First step with Ferret</title>
      <description>&lt;p&gt;If you don&amp;#8217;t want to lost your time (&lt;em&gt;about 2 hours for me&lt;/em&gt;), don&amp;#8217;t understand why your change in your model are not taking in account, and then understand there with a thread that&amp;#8217;s cannot be killed then block you model, &lt;em&gt;&lt;strong&gt;create the ferret index at startup&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;


	&lt;p&gt;In your &lt;code&gt;environment.rb&lt;/code&gt;:&lt;/p&gt;


&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_ruby "&gt;&lt;span class="ident"&gt;require&lt;/span&gt; &lt;span class="punct"&gt;'&lt;/span&gt;&lt;span class="string"&gt;ferret&lt;/span&gt;&lt;span class="punct"&gt;'&lt;/span&gt;
&lt;span class="ident"&gt;include&lt;/span&gt; &lt;span class="constant"&gt;Ferret&lt;/span&gt;
&lt;span class="constant"&gt;FERRET_INDEX&lt;/span&gt; &lt;span class="punct"&gt;=&lt;/span&gt; &lt;span class="constant"&gt;Index&lt;/span&gt;&lt;span class="punct"&gt;::&lt;/span&gt;&lt;span class="constant"&gt;Index&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;new&lt;/span&gt;&lt;span class="punct"&gt;(&lt;/span&gt;&lt;span class="symbol"&gt;:path&lt;/span&gt; &lt;span class="punct"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="constant"&gt;FERRET_INDEX_DIR&lt;/span&gt;&lt;span class="punct"&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;p&gt;With &lt;code&gt;FERRET_INDEX_DIR&lt;/code&gt; is the path to your index directory and then you can use &lt;code&gt;FERRET_INDEX&lt;/code&gt; whereever you want in your application. Later I will deal with how to initialize my index :p&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;Links for ferret&lt;/strong&gt;&lt;/p&gt;


For those who don&amp;#8217;t know ferret, it&amp;#8217;s the inspired Lucene of ruby search engine, very powerful and fast:
	&lt;ul&gt;
	&lt;li&gt;&lt;a href="http://ferret.davebalmain.com/trac"&gt;start here: trac&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href="http://ferret.davebalmain.com/api/files/TUTORIAL.html"&gt;tutorial&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href="http://projects.jkraemer.net/acts_as_ferret/"&gt;acts_as_ferret&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;</description>
      <pubDate>Sun, 08 Apr 2007 20:21:00 +0200</pubDate>
      <guid isPermaLink="false">urn:uuid:b92465f2-7788-4e84-a085-4fcf9deaf512</guid>
      <author>stephane</author>
      <link>http://www.rubynaut.net/articles/2007/04/08/first-step-with-ferret</link>
      <trackback:ping>http://www.rubynaut.net/articles/trackback/14172</trackback:ping>
    </item>
  </channel>
</rss>
