<?xml version="1.0" encoding="UTF-8"?>
<wiki>
  <body>&lt;p&gt;The &lt;strong&gt;scoped_search&lt;/strong&gt; plugin consists of three parts:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;The query language parser;&lt;/li&gt;
	&lt;li&gt;The &lt;span class=&quot;caps&quot;&gt;SQL&lt;/span&gt; conditions builder;&lt;/li&gt;
	&lt;li&gt;The part that bolts the functionality onto ActiveRecord.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Query language parser&lt;/h2&gt;
&lt;p&gt;File: &lt;a href=&quot;http://github.com/wvanbergen/scoped_search/tree/master/lib/scoped_search/query_language_parser.rb&quot;&gt;&lt;code&gt;lib/scoped_search/query_language_parser.rb&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This file parses the query string and returns the result as an array of search terms.&lt;/p&gt;
&lt;h2&gt;&lt;span class=&quot;caps&quot;&gt;SQL&lt;/span&gt; conditions builder&lt;/h2&gt;
&lt;p&gt;File: &lt;a href=&quot;http://github.com/wvanbergen/scoped_search/tree/master/lib/scoped_search/query_conditions_builder.rb&quot;&gt;&lt;code&gt;lib/scoped_search/query_conditions_builder.rb&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Creates &lt;span class=&quot;caps&quot;&gt;WHERE&lt;/span&gt; clause conditions for every field that must be searched, using the array of search terms. This part is a bit &lt;span class=&quot;caps&quot;&gt;DBMS&lt;/span&gt; specific.&lt;/p&gt;
&lt;h2&gt;Integration with ActiveRecord&lt;/h2&gt;
&lt;p&gt;File: &lt;a href=&quot;http://github.com/wvanbergen/scoped_search/tree/master/lib/scoped_search.rb&quot;&gt;&lt;code&gt;lib/scoped_search.rb&lt;/code&gt;&lt;/a&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Adds the &lt;code&gt;searchable_on&lt;/code&gt; method to the the &lt;code&gt;ActiveRecord::Base&lt;/code&gt; class. Calling this method on a subclass will create the &lt;code&gt;search_for&lt;/code&gt; named scope.&lt;/p&gt;</body>
  <created-at type="datetime">2009-11-25T01:37:22-08:00</created-at>
  <id type="integer">124404</id>
  <permalink>design-and-internals</permalink>
  <repository-id type="integer">37427</repository-id>
  <title>Design and internals</title>
  <updated-at type="datetime">2009-01-28T23:22:57-08:00</updated-at>
  <user-id type="integer">15870</user-id>
</wiki>
