<?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>Slash Dot Dash: Sphinx search with delta indexing thanks to Ultrasphinx</title>
    <link>http://www.slashdotdash.net/articles/2008/03/09/sphinx-search-with-delta-indexing-thanks-to-ultrasphinx</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Rolling on Rails</description>
    <item>
      <title>Sphinx search with delta indexing thanks to Ultrasphinx</title>
      <description>&lt;p&gt;Evan Weaver has &lt;a href="http://blog.evanweaver.com/articles/2008/03/08/delta-indexing-support-in-ultrasphinx/"&gt;just announced delta indexing support&lt;/a&gt; for his UltraSphinx Rails plugin.&lt;/p&gt;


	&lt;blockquote&gt;
		&lt;p&gt;Delta indexing speeds up your updates by not reindexing the entire dataset every time.&lt;br /&gt;&lt;br /&gt;First, in your .base file, set the indexer option delta to your maximum interval between full reindexes. A day or a week is good, depending. Add a little bit to account for the time it takes the actual index to run:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;delta = &amp;lt;%= 1.day + 30.minutes %&amp;gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Now, configure your models for delta indexing in the is_indexed call:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;is_indexed :fields =&amp;gt; ['created_at', 'title', 'body'], :delta =&amp;gt; true&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Now you can run &lt;code&gt;rake ultrasphinx:index:delta&lt;/code&gt; frequently, and only records that were changed within 1 day will be reindexed. You will need to run rake ultrasphinx:index:main once a day to move the delta contents into the main index.&lt;/p&gt;
	&lt;/blockquote&gt;


	&lt;p&gt;From the &lt;a href="http://blog.evanweaver.com/files/doc/fauna/ultrasphinx/files/README.html"&gt;UltraSphinx documentation&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;I&amp;#8217;ve previously written about how fast Sphinx search is in &lt;a href="http://www.slashdotdash.net/articles/2007/08/06/rails-searching-with-sphinx"&gt;Rails searching with Sphinx&lt;/a&gt; using the &lt;code&gt;acts_as_sphinx&lt;/code&gt; plugin (and also contributed a chapter to the Advanced Rails Recipes book using the UltraSphinx plugin). I&amp;#8217;d now recommend using the UltraSphinx plugin if you want to take advantage of Sphinx for your Rails application.&lt;/p&gt;


	&lt;p&gt;In my opinion, this completes the &amp;#8216;missing&amp;#8217; piece of functionality and should make Sphinx your default full-text search engine (if you&amp;#8217;re using MySQL).&lt;/p&gt;</description>
      <pubDate>Sun, 09 Mar 2008 13:58:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:f61c10fc-ffc3-4d10-808d-a5a933f7e532</guid>
      <author>ben@slashdotdash.net (Ben)</author>
      <link>http://www.slashdotdash.net/articles/2008/03/09/sphinx-search-with-delta-indexing-thanks-to-ultrasphinx</link>
      <category>Ruby on Rails</category>
    </item>
  </channel>
</rss>
