<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Amos blog on scoped search</title>
	<atom:link href="http://scopedsearch.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://scopedsearch.wordpress.com</link>
	<description>Why and how to use scoped search</description>
	<lastBuildDate>Tue, 01 May 2012 08:39:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='scopedsearch.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Amos blog on scoped search</title>
		<link>http://scopedsearch.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://scopedsearch.wordpress.com/osd.xml" title="Amos blog on scoped search" />
	<atom:link rel='hub' href='http://scopedsearch.wordpress.com/?pushpress=hub'/>
		<item>
		<title>A brand new scoped_search 2.3.7 just released.</title>
		<link>http://scopedsearch.wordpress.com/2012/04/30/a-brand-new-scoped_search-2-3-7-just-released/</link>
		<comments>http://scopedsearch.wordpress.com/2012/04/30/a-brand-new-scoped_search-2-3-7-just-released/#comments</comments>
		<pubDate>Mon, 30 Apr 2012 13:03:04 +0000</pubDate>
		<dc:creator>Amos Benari</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://scopedsearch.wordpress.com/?p=190</guid>
		<description><![CDATA[This time we have a new feature many thanks to cj. The new scoped search release now supports syntax similar to SQL IN and NOT IN. It is now possible to write the following syntax: auth_level ^ (5,7,14) instead of having to do auth_level = 5 OR auth_level = 7 OR auth_level = 14 Same [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=scopedsearch.wordpress.com&#038;blog=24606654&#038;post=190&#038;subd=scopedsearch&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>This time we have a new feature many thanks to <a href="http://cj.io" target="_blank">cj</a>. The new scoped search release now supports syntax similar to SQL IN and NOT IN. It is now possible to write the following syntax:</p>
<blockquote><p><code>auth_level ^ (5,7,14)</code></p>
<p>instead of having to do</p>
<p><code>auth_level = 5 OR auth_level = 7 OR auth_level = 14</code></p></blockquote>
<p>Same goes for:</p>
<blockquote><p><code>first_name !^ ('chris', 'peter')</code></p>
<p>instead of having</p>
<p><code>first_name != 'chris' and  first_name != 'peter'</code></p></blockquote>
<p>Except for the new feature we have one bug fixed in this release.</p>
<ul>
<li><a href="http://github.com/wvanbergen/scoped_search/issues/20" target="_blank">When using external methods that returns an empty hash, incorrect SQL is generated</a></li>
</ul>
<p>Many thanks to <em>Ohad Levy</em> for taking the time to report the bugs.</p>
<p>The release is available to download from <a href="http://rubygems.org/gems/scoped_search/versions/2.3.6" target="_blank">rubygems.org</a> . Sources can be found in <a href="https://github.com/wvanbergen/scoped_search/" target="_blank">github</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/scopedsearch.wordpress.com/190/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/scopedsearch.wordpress.com/190/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=scopedsearch.wordpress.com&#038;blog=24606654&#038;post=190&#038;subd=scopedsearch&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://scopedsearch.wordpress.com/2012/04/30/a-brand-new-scoped_search-2-3-7-just-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ff01b1443724a0ae730a4ab2ca15e198?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">aujuhrmq</media:title>
		</media:content>
	</item>
		<item>
		<title>scoped_search 2.3.6 released</title>
		<link>http://scopedsearch.wordpress.com/2011/11/13/scoped_search-2-3-6-released/</link>
		<comments>http://scopedsearch.wordpress.com/2011/11/13/scoped_search-2-3-6-released/#comments</comments>
		<pubDate>Sun, 13 Nov 2011 10:19:29 +0000</pubDate>
		<dc:creator>Amos Benari</dc:creator>
				<category><![CDATA[Developers]]></category>

		<guid isPermaLink="false">http://scopedsearch.wordpress.com/?p=181</guid>
		<description><![CDATA[Yet another bug fixes release is available to download from rubygems.org. Sources can be found in github. Changes from last release(2.3.5): when external methods create an empty conditions string,  an invalid sql is produced. suggest value completion after operators without typing a space. safer code to prevent possible null pointer exception in the auto completer. Many thanks [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=scopedsearch.wordpress.com&#038;blog=24606654&#038;post=181&#038;subd=scopedsearch&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Yet another bug fixes release is available to download from<a href="http://rubygems.org/gems/scoped_search/versions/2.3.6"> rubygems.org</a>. Sources can be found in <a href="https://github.com/wvanbergen/scoped_search/">github</a>.</p>
<p>Changes from last release(2.3.5):</p>
<ul>
<li>when external methods create an empty conditions string,  an invalid sql is produced.</li>
<li>suggest value completion after operators without typing a space.</li>
<li>safer code to prevent possible null pointer exception in the auto completer.</li>
</ul>
<p>Many thanks to <em>Brad Backingham</em> and <em>Steve Traylen</em> for taking the time to report the bugs.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/scopedsearch.wordpress.com/181/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/scopedsearch.wordpress.com/181/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=scopedsearch.wordpress.com&#038;blog=24606654&#038;post=181&#038;subd=scopedsearch&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://scopedsearch.wordpress.com/2011/11/13/scoped_search-2-3-6-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ff01b1443724a0ae730a4ab2ca15e198?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">aujuhrmq</media:title>
		</media:content>
	</item>
		<item>
		<title>New scoped search Release &#8211; 2.3.5</title>
		<link>http://scopedsearch.wordpress.com/2011/10/19/new-scoped-search-release-2-3-5/</link>
		<comments>http://scopedsearch.wordpress.com/2011/10/19/new-scoped-search-release-2-3-5/#comments</comments>
		<pubDate>Wed, 19 Oct 2011 10:00:40 +0000</pubDate>
		<dc:creator>Amos Benari</dc:creator>
				<category><![CDATA[Developers]]></category>

		<guid isPermaLink="false">http://scopedsearch.wordpress.com/?p=175</guid>
		<description><![CDATA[Another bug fixes release is available to download from rubygems.org. Sources can be found in github. All the fixed bugs are related to the auto-completer component. Changes from last release(2.3.4): value and key-name auto completer may produce abiguoes sql. fixed value auto-completer sql exception when single quote is used. fixed value completion after the first quotes. auto-completer [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=scopedsearch.wordpress.com&#038;blog=24606654&#038;post=175&#038;subd=scopedsearch&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Another bug fixes release is available to download from<a href="http://rubygems.org/gems/scoped_search/versions/2.3.5"> rubygems.org</a>. Sources can be found in <a href="https://github.com/wvanbergen/scoped_search/">github</a>.</p>
<p>All the fixed bugs are related to the auto-completer component.</p>
<p>Changes from last release(2.3.4):</p>
<ul>
<li>value and key-name auto completer may produce abiguoes sql.</li>
<li>fixed value auto-completer sql exception when single quote is used.</li>
<li>fixed value completion after the first quotes.</li>
<li>auto-completer fails when query starts with &#8220;or &#8220;</li>
</ul>
<p>Many thanks to <em>Brad Backingham</em>,  <em>Eric Helms </em> and <em>Jeff Weiss </em> for taking the time to report the bugs.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/scopedsearch.wordpress.com/175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/scopedsearch.wordpress.com/175/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=scopedsearch.wordpress.com&#038;blog=24606654&#038;post=175&#038;subd=scopedsearch&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://scopedsearch.wordpress.com/2011/10/19/new-scoped-search-release-2-3-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ff01b1443724a0ae730a4ab2ca15e198?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">aujuhrmq</media:title>
		</media:content>
	</item>
		<item>
		<title>scoped search 2.3.4 has been released</title>
		<link>http://scopedsearch.wordpress.com/2011/10/03/scoped-search-2-3-4-has-been-released/</link>
		<comments>http://scopedsearch.wordpress.com/2011/10/03/scoped-search-2-3-4-has-been-released/#comments</comments>
		<pubDate>Mon, 03 Oct 2011 10:32:46 +0000</pubDate>
		<dc:creator>Amos Benari</dc:creator>
				<category><![CDATA[Developers]]></category>

		<guid isPermaLink="false">http://scopedsearch.wordpress.com/?p=167</guid>
		<description><![CDATA[A new scoped_search bug fixes release is available to download from rubygems.org. Sources can be found in github. Changes from last release(2.3.3): Fixed: Missing table name in the auto_completer distinct phrase may cause ambiguous sql query. Reported by Brad Backingham. Fixed: Null pointer exception on dot as a search string.  Reported by Eric Thomas (https://github.com/wvanbergen/scoped_search/issues/14) Fixed: Foreman [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=scopedsearch.wordpress.com&#038;blog=24606654&#038;post=167&#038;subd=scopedsearch&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>A new scoped_search bug fixes release is available to download from<a href="http://rubygems.org/gems/scoped_search/versions/2.3.4"> rubygems.org</a>. Sources can be found in <a href="https://github.com/wvanbergen/scoped_search/">github</a>.</p>
<p>Changes from last release(2.3.3):</p>
<ul>
<li>Fixed: Missing table name in the auto_completer distinct phrase may cause ambiguous sql query. Reported by Brad Backingham.</li>
<li>Fixed: Null pointer exception on dot as a search string.  Reported by Eric Thomas (<a href="https://github.com/wvanbergen/scoped_search/issues/14" rel="nofollow">https://github.com/wvanbergen/scoped_search/issues/14</a>)</li>
<li>Fixed: Foreman bug #1181: Host searching returns duplicates (or-ed facts). Reported and fixed by Tim Speetjens (<a href="http://theforeman.org/issues/1181" rel="nofollow">http://theforeman.org/issues/1181</a> )</li>
</ul>
<p>Many thanks to <em>Brad Backingham</em>,  <em>Eric Thomas</em> and <em>Tim Speetjens</em> for taking the time to report bugs, and send patches.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/scopedsearch.wordpress.com/167/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/scopedsearch.wordpress.com/167/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=scopedsearch.wordpress.com&#038;blog=24606654&#038;post=167&#038;subd=scopedsearch&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://scopedsearch.wordpress.com/2011/10/03/scoped-search-2-3-4-has-been-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ff01b1443724a0ae730a4ab2ca15e198?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">aujuhrmq</media:title>
		</media:content>
	</item>
		<item>
		<title>New release of scoped_search</title>
		<link>http://scopedsearch.wordpress.com/2011/09/06/new-release-of-scoped_search/</link>
		<comments>http://scopedsearch.wordpress.com/2011/09/06/new-release-of-scoped_search/#comments</comments>
		<pubDate>Tue, 06 Sep 2011 13:54:47 +0000</pubDate>
		<dc:creator>Amos Benari</dc:creator>
				<category><![CDATA[Developers]]></category>

		<guid isPermaLink="false">http://scopedsearch.wordpress.com/?p=159</guid>
		<description><![CDATA[A new scoped_search release is available 2.3.3 http://rubygems.org/gems/scoped_search/versions/2.3.3 2.3.2 was skipped by mistake. I made  an error when running the release script. Changes from last release(2.3.1): Auto-completer results can now be filtered, For usage see: permission-model-for-the-search Fixed issue with decimal columns https://github.com/wvanbergen/scoped_search/issues/12 Auto completer ajax controller can now pass a filter parameter to the auto-completer method in [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=scopedsearch.wordpress.com&#038;blog=24606654&#038;post=159&#038;subd=scopedsearch&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>A new scoped_search release is available 2.3.3<br />
<a href="http://rubygems.org/gems/scoped_search/versions/2.3.3" target="_blank">http://rubygems.org/gems/scoped_search/versions/2.3.3</a></p>
<p>2.3.2 was skipped by mistake. I made  an error when running the release script.</p>
<p>Changes from last release(2.3.1):</p>
<ul>
<li>Auto-completer results can now be filtered, For usage see:</li>
</ul>
<p style="padding-left:30px;"><a title="Applying permission model to search results" href="http://scopedsearch.wordpress.com/2011/08/01/permission-model-for-the-search/">permission-model-for-the-search</a></p>
<ul>
<li>Fixed issue with decimal columns</li>
</ul>
<p style="padding-left:30px;"><a href="https://github.com/wvanbergen/scoped_search/issues/12" target="_blank">https://github.com/wvanbergen/scoped_search/issues/12</a></p>
<ul>
<li>Auto completer ajax controller can now pass a filter parameter to the auto-completer method in addition to the search string.</li>
</ul>
<p style="padding-left:30px;">usage:</p>
<pre>&lt;%= auto_complete_field_tag_jquery(
:search,
params[:search],
{:placeholder =&gt; 'Type Space for Search Options'},
{:filter =&gt; 'new filter option'}) %&gt;</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/scopedsearch.wordpress.com/159/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/scopedsearch.wordpress.com/159/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=scopedsearch.wordpress.com&#038;blog=24606654&#038;post=159&#038;subd=scopedsearch&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://scopedsearch.wordpress.com/2011/09/06/new-release-of-scoped_search/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ff01b1443724a0ae730a4ab2ca15e198?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">aujuhrmq</media:title>
		</media:content>
	</item>
		<item>
		<title>Scoped search comparison operators</title>
		<link>http://scopedsearch.wordpress.com/2011/08/11/scoped-search-comparison-operators/</link>
		<comments>http://scopedsearch.wordpress.com/2011/08/11/scoped-search-comparison-operators/#comments</comments>
		<pubDate>Thu, 11 Aug 2011 14:14:27 +0000</pubDate>
		<dc:creator>Amos Benari</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Developers]]></category>

		<guid isPermaLink="false">http://scopedsearch.wordpress.com/?p=143</guid>
		<description><![CDATA[Scoped search uses ActiveRecord infrastructure to learn about the database schema. The auto-completer uses the column type to suggest the optional operators. Textual fields will have &#8216;~&#8217; (like), &#8216;!~&#8217; (unlike), &#8217;=&#8217; and &#8216;!=&#8217;. Numerical fields will have &#8216;&#62;&#8217;, &#8216;&#60;&#8217;, &#8216;&#62;=&#8217;, &#8216;&#60;=&#8217;, &#8216;=&#8217; and &#8216;!=&#8217;. Usualy this is something a developer using scoped search doesn&#8217;t need to [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=scopedsearch.wordpress.com&#038;blog=24606654&#038;post=143&#038;subd=scopedsearch&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Scoped search uses ActiveRecord infrastructure to learn about the database schema. The auto-completer uses the column type to suggest the optional operators. Textual fields will have &#8216;~&#8217; (like), &#8216;!~&#8217; (unlike), &#8217;=&#8217; and &#8216;!=&#8217;. Numerical fields will have &#8216;&gt;&#8217;, &#8216;&lt;&#8217;, &#8216;&gt;=&#8217;, &#8216;&lt;=&#8217;, &#8216;=&#8217; and &#8216;!=&#8217;. Usualy this is something a developer using scoped search doesn&#8217;t need to worry about, scope search find the database column type and suggest the relevant operators, however there could be some cases where a developer will want to limit the operators set for a particular search term.</p>
<p>The syntax to control the auto-completer suggested operator list is to add :operators =&gt; { &#8216;=&#8217;, &#8216;!=&#8217; } to the scoped_search command.</p>
<p>&nbsp;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/scopedsearch.wordpress.com/143/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/scopedsearch.wordpress.com/143/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=scopedsearch.wordpress.com&#038;blog=24606654&#038;post=143&#038;subd=scopedsearch&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://scopedsearch.wordpress.com/2011/08/11/scoped-search-comparison-operators/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ff01b1443724a0ae730a4ab2ca15e198?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">aujuhrmq</media:title>
		</media:content>
	</item>
		<item>
		<title>Searching a multiplexed database column</title>
		<link>http://scopedsearch.wordpress.com/2011/08/04/searching-a-multiplexed-database-column/</link>
		<comments>http://scopedsearch.wordpress.com/2011/08/04/searching-a-multiplexed-database-column/#comments</comments>
		<pubDate>Thu, 04 Aug 2011 19:13:23 +0000</pubDate>
		<dc:creator>Amos Benari</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Developers]]></category>

		<guid isPermaLink="false">http://scopedsearch.wordpress.com/?p=137</guid>
		<description><![CDATA[Multiplexing columns is an optimization used in some database  schema. The idea is to store multiple integers or boolean values  in a single integer column. The read and write operations are done using bit wise operators. For example we can store several flags in a single integer column, the first flag value is 1, the [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=scopedsearch.wordpress.com&#038;blog=24606654&#038;post=137&#038;subd=scopedsearch&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Multiplexing columns is an optimization used in some database  schema. The idea is to store multiple integers or boolean values  in a single integer column. The read and write operations are done using bit wise operators. For example we can store several flags in a single integer column, the first flag value is 1, the second 2, the third value is 4, etc.</p>
<p>Scoped search is able to expose multiplexed filed by specifying the offset and word size. In the common case of multiplexing booleans, the word size is 1.</p>
<pre class="brush: ruby; title: ; notranslate">scoped_search :on =&gt; :counters, :offset =&gt; 0 , :word_size =&gt; 6, :rename =&gt; :applied
scoped_search :on =&gt; :counters, :offset =&gt; 1 , :word_size =&gt; 6, :rename =&gt; :skipped</pre>
<p>The search syntax will expose the multiplexed column as multiple columns.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/scopedsearch.wordpress.com/137/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/scopedsearch.wordpress.com/137/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=scopedsearch.wordpress.com&#038;blog=24606654&#038;post=137&#038;subd=scopedsearch&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://scopedsearch.wordpress.com/2011/08/04/searching-a-multiplexed-database-column/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ff01b1443724a0ae730a4ab2ca15e198?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">aujuhrmq</media:title>
		</media:content>
	</item>
		<item>
		<title>Using scoped search UI helpers</title>
		<link>http://scopedsearch.wordpress.com/2011/08/02/using-scoped-search-ui-helpers/</link>
		<comments>http://scopedsearch.wordpress.com/2011/08/02/using-scoped-search-ui-helpers/#comments</comments>
		<pubDate>Tue, 02 Aug 2011 22:25:29 +0000</pubDate>
		<dc:creator>Amos Benari</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Developers]]></category>

		<guid isPermaLink="false">http://scopedsearch.wordpress.com/?p=130</guid>
		<description><![CDATA[Scoped search comes packed with some handy GUI helpers. An ajax auto completer that handles the auto-completer drop-down box, and column sort helpers. The ajax auto-completer drop-down comes in two flavors one for JQuery and the other for Prototype. The code samples in this post will use the JQuery flavor. Here is an example of [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=scopedsearch.wordpress.com&#038;blog=24606654&#038;post=130&#038;subd=scopedsearch&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Scoped search comes packed with some handy GUI helpers. An ajax auto completer that handles the auto-completer drop-down box, and column sort helpers.</p>
<p>The ajax auto-completer drop-down comes in two flavors one for JQuery and the other for Prototype. The code samples in this post will use the JQuery flavor.</p>
<p>Here is an example of the auto-completer ajax drop-down usage, in the view place the following form tag where you want the search box to show:</p>
<pre class="brush: xml; title: ; notranslate">&lt;%= form_tag books_path, :method =&gt; :get do %&gt;
  &lt;%= auto_complete_field_tag_jquery(:search, params[:search], {:placeholder =&gt; &quot;Filter ...&quot;}) %&gt;
  &lt;button id='submit_search'&quot;&gt;Search&lt;/button&gt;
&lt;% end -%&gt;
</pre>
<p>To control the look of the search box use the following css classes: ui-autocomplete-input, ui-autocomplete-loading and ui-autocomplete-error. The auto_complete_field_tag_jquery accepts additional options hash for further controlling it&#8217;s behavior such as delay and min_length.</p>
<p>Another useful helper method is the sort helper. The sort helper draws an arrow at the top of the sorted column pointing to the sort direction, it also adds order parameter to the url. Together with the ability of the scoped_search to add an order-by sql clause, it makes a complete sorting solution. The reason for sending a new request to the database instead of sorting in the client is that many applications uses pagination. When using pagination client side sort may cause wrong results. Here is an example of using the sort helper:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;table&gt;
  &lt;tr&gt;
    &lt;th&gt;&lt;%= sort :name %&gt;&lt;/th&gt;
    &lt;th&gt;&lt;%= sort :&quot;author.last&quot;, :as =&gt; &quot;Author&quot; %&gt;&lt;/th&gt;
  &lt;/tr&gt;
  &lt;% for book in @books %&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;%= book.name %&gt;&lt;/td&gt;
      &lt;td&gt;&lt;%= book.author %&gt;&lt;/td&gt;
      &lt;td&gt;&lt;%= link_to &quot;Show&quot;, book %&gt;&lt;/td&gt;
      &lt;td&gt;&lt;%= link_to &quot;Edit&quot;, edit_book_path(book) %&gt;&lt;/td&gt;
      &lt;td&gt;&lt;%= link_to &quot;Destroy&quot;, book, :confirm =&gt; 'Are you sure?', :method =&gt; :delete %&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;% end %&gt;
&lt;/table&gt;
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/scopedsearch.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/scopedsearch.wordpress.com/130/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=scopedsearch.wordpress.com&#038;blog=24606654&#038;post=130&#038;subd=scopedsearch&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://scopedsearch.wordpress.com/2011/08/02/using-scoped-search-ui-helpers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ff01b1443724a0ae730a4ab2ca15e198?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">aujuhrmq</media:title>
		</media:content>
	</item>
		<item>
		<title>Applying permission model to search results</title>
		<link>http://scopedsearch.wordpress.com/2011/08/01/permission-model-for-the-search/</link>
		<comments>http://scopedsearch.wordpress.com/2011/08/01/permission-model-for-the-search/#comments</comments>
		<pubDate>Mon, 01 Aug 2011 12:24:01 +0000</pubDate>
		<dc:creator>Amos Benari</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Developers]]></category>

		<guid isPermaLink="false">http://scopedsearch.wordpress.com/?p=108</guid>
		<description><![CDATA[Enterprise applications usually have a role base access control (RBAC). The search results as well as the auto-completer suggestions must conform to the access control model. The recommended way to control the search results, using scoped_search, is chaining scopes. The scoped_search is a named scope (scope in rails 3), this means that it can be [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=scopedsearch.wordpress.com&#038;blog=24606654&#038;post=108&#038;subd=scopedsearch&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Enterprise applications usually have a role base access control (RBAC). The search results as well as the auto-completer suggestions must conform to the access control model. The recommended way to control the search results, using scoped_search, is chaining scopes. The scoped_search is a named scope (scope in rails 3), this means that it can be chained with other scopes in a natural way.</p>
<p>For example:</p>
<pre class="brush: ruby; title: ; notranslate"> scope :my_hosts, lambda {
where(&quot;owner_id = ?&quot;, User.current.id)
}
Host.my_hosts.search_for(query)</pre>
<p>In the above code :my_hosts is the RBAC scope (defined in lines 1 to 3). In line 4 the search is chained to the RBAC scope.</p>
<p>For the auto-completer there is a new way of filtering the results in a similar way. In the Model we can define a scope called :compelter_scope , this scope should accept an options hash. The options hash is a way to pass parameters from the controller, such as the current user.</p>
<p>For example:<br />
Model code:</p>
<pre class="brush: ruby; title: ; notranslate">scope :completer_scope, lambda { |options|
  where('owner_id = ?', options[:owner_id])
}</pre>
<p>Controller code:
<pre class="brush: ruby; title: ; notranslate">def auto_complete_search
  @items = Host.complete_for(params[:search], {:owner_id =&gt; User.current.id})
  render :json =&gt; @items
end</pre>
<p>To read more about named scopes, here is a link to a detailed post on the subject: <a href="http://edgerails.info/articles/what-s-new-in-edge-rails/2010/02/23/the-skinny-on-scopes-formerly-named-scope/index.html" target="_blank">Skinny on scopes</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/scopedsearch.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/scopedsearch.wordpress.com/108/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=scopedsearch.wordpress.com&#038;blog=24606654&#038;post=108&#038;subd=scopedsearch&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://scopedsearch.wordpress.com/2011/08/01/permission-model-for-the-search/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ff01b1443724a0ae730a4ab2ca15e198?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">aujuhrmq</media:title>
		</media:content>
	</item>
		<item>
		<title>Search with Sinatra now on github</title>
		<link>http://scopedsearch.wordpress.com/2011/07/31/search-with-sinatra-now-on-github/</link>
		<comments>http://scopedsearch.wordpress.com/2011/07/31/search-with-sinatra-now-on-github/#comments</comments>
		<pubDate>Sun, 31 Jul 2011 14:15:58 +0000</pubDate>
		<dc:creator>Amos Benari</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Developers]]></category>

		<guid isPermaLink="false">http://scopedsearch.wordpress.com/?p=105</guid>
		<description><![CDATA[The code for my mini_search, a simple RESTful API based search for a none-rails application, is now on github see: mini_search code.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=scopedsearch.wordpress.com&#038;blog=24606654&#038;post=105&#038;subd=scopedsearch&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>The code for my <a title="Adding Search to Sinatra" href="http://scopedsearch.wordpress.com/2011/07/27/adding-search-to-sinatra/">mini_search</a>, a simple RESTful API based search for a none-rails application, is now on github see: <a href="http://github.com/abenari/mini_search" target="_blank">mini_search code</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/scopedsearch.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/scopedsearch.wordpress.com/105/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=scopedsearch.wordpress.com&#038;blog=24606654&#038;post=105&#038;subd=scopedsearch&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://scopedsearch.wordpress.com/2011/07/31/search-with-sinatra-now-on-github/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ff01b1443724a0ae730a4ab2ca15e198?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">aujuhrmq</media:title>
		</media:content>
	</item>
	</channel>
</rss>
