<?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/"
	>

<channel>
	<title>Vinsol - Leading Ruby on Rails Development and Consulting Firm in India &#187; acts_as_solr</title>
	<atom:link href="http://vinsol.com/blog/category/acts_as_solr/feed/" rel="self" type="application/rss+xml" />
	<link>http://vinsol.com/blog</link>
	<description></description>
	<lastBuildDate>Wed, 11 Jan 2012 06:07:52 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Acts as solr: Logical Search</title>
		<link>http://vinsol.com/blog/2008/04/15/acts-as-solr-logical-search/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=acts-as-solr-logical-search</link>
		<comments>http://vinsol.com/blog/2008/04/15/acts-as-solr-logical-search/#comments</comments>
		<pubDate>Tue, 15 Apr 2008 08:37:00 +0000</pubDate>
		<dc:creator>SUR</dc:creator>
				<category><![CDATA[acts_as_solr]]></category>
		<category><![CDATA[logical_search]]></category>

		<guid isPermaLink="false">http://expressica.com/2008/04/15/acts-as-solr-logical-search/</guid>
		<description><![CDATA[There are a couple of ways described in acts_as_solr documentation for the logical search, with AND or OR operations. But I needed to dig a bit into the code as the documentation is not complete and doesn&#8217;t suggest all the possible implementations of making the complex Logic Gates for searching.
Here I am consolidating various possibilities [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>There are a couple of ways described in acts_as_solr documentation for the logical search, with AND or OR operations. But I needed to dig a bit into the code as the documentation is not complete and doesn&#8217;t suggest all the possible implementations of making the complex Logic Gates for searching.<br />
Here I am consolidating various possibilities of Logical Search&#8230;</p>
<p><b>Find all blogs with category ruby or rails</b></p>
<textarea name="code" class="ruby:nocontrols:nogutter" cols="60" rows="10">

  Blog.find_by_solr("category:rails category:ruby", :operator => :or)

</textarea>
<p>another way</p>
<textarea name="code" class="ruby:nocontrols:nogutter" cols="60" rows="10">
 
 Blog.find_by_solr("category:rails OR category:ruby")

</textarea>
<p><b>Find all blogs with categories ruby and rails</b></p>
<textarea name="code" class="ruby:nocontrols:nogutter" cols="60" rows="10">
  Blog.find_by_solr("category:rails category:ruby", :operator => :and)
</textarea>
<p>another way</p>
<textarea name="code" class="ruby:nocontrols:nogutter" cols="60" rows="10">
  Blog.find_by_solr("category:rails AND category:ruby")
</textarea>
<h3>Grouping for more precision</h3>
<p><font color='red'>NOTE: mind the grouping using parenthesis, you might get unexpected results without proper grouping.</font></p>
<p><b>Find all blogs with categories ruby or rails with author Sur</b></p>
<textarea name="code" class="ruby:nocontrols:nogutter" cols="60" rows="10">
  Blog.find_by_solr("(category:rails OR category:ruby) author:sur")
</textarea>
<p><b>Find all blogs with categories ruby AND rails with author Sur</b></p>
<textarea name="code" class="ruby:nocontrols:nogutter" cols="60" rows="10">
  Blog.find_by_solr("(category:rails AND category:ruby) author:sur")
</textarea>
<p><b>Find all blogs with categories ruby or rails with author Sur or David</b></p>
<textarea name="code" class="ruby:nocontrols:nogutter" cols="60" rows="10">
  Blog.find_by_solr("(category:rails OR category:ruby) (author:sur OR author:David)")
</textarea>
<p><b>Find all blogs with categories ruby and rails with author Sur or David</b></p>
<textarea name="code" class="ruby:nocontrols:nogutter" cols="60" rows="10">
  Blog.find_by_solr("(category:rails AND category:ruby) (author:sur OR author:David)")
</textarea>
]]></content:encoded>
			<wfw:commentRss>http://vinsol.com/blog/2008/04/15/acts-as-solr-logical-search/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Acts_as_solr: Starting solr server on windows</title>
		<link>http://vinsol.com/blog/2007/09/13/acts_as_solr-starting-solr-server-on-windows/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=acts_as_solr-starting-solr-server-on-windows</link>
		<comments>http://vinsol.com/blog/2007/09/13/acts_as_solr-starting-solr-server-on-windows/#comments</comments>
		<pubDate>Thu, 13 Sep 2007 08:54:40 +0000</pubDate>
		<dc:creator>Akhil Bansal</dc:creator>
				<category><![CDATA[RubyonRails]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[acts_as_solr]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[rails plugins]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[solr]]></category>

		<guid isPermaLink="false">http://webonrails.com/2007/09/13/acts_as_solr-starting-solr-server-on-windows/</guid>
		<description><![CDATA[I was using acts_as_searchable for one of my project, which uses Hyperestraier in background. Yesterday I decided to use acts_as_solr which uses solr(based on Lucene Java search library). I did all written in its Manual/Readme, but when I issued 
 
rake solr:start

to start the solr server, it threw a heart breaking &#8220;Bad file descriptor&#8221; error, [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>I was using acts_as_searchable for one of my project, which uses Hyperestraier in background. Yesterday I decided to use acts_as_solr which uses solr(based on Lucene Java search library). I did all written in its Manual/Readme, but when I issued </p>
<textarea name="code" class="ruby" cols="50" rows="10"> 
rake solr:start
</textarea>
<p>to start the solr server, it threw a heart breaking &#8220;Bad file descriptor&#8221; error, although acts_as_solr was working fine on one of my colleague&#8217;s linux machine. </p>
<p>I started digging around this and found that there is an issue in rake task that starts the solr server. Actually the problem was this rake task uses &#8216;fork&#8217; which is not available on windows, also it only handles &#8216;ECONNREFUSED&#8217; exception which is actually &#8220;Connection Refused&#8221; error raised by ruby on linux. But in windown it throws &#8216;EBADF&#8217; which is &#8220;Bad file descriptor&#8221; error raised by ruby on windows. </p>
<p>So below is the hack for that:</p>
<textarea name="code" class="ruby" cols="50" rows="10">
  desc 'Starts Solr. on windows . Options accepted: RAILS_ENV=your_env, PORT=XX. Defaults to development if none.'
  task :start_win do
    begin
      n = Net::HTTP.new('localhost', SOLR_PORT)
      n.request_head('/').value 

    rescue Net::HTTPServerException #responding
      puts "Port #{SOLR_PORT} in use" and return

    rescue Errno::EBADF #not responding
      Dir.chdir(SOLR_PATH) do
          exec "java -Dsolr.data.dir=solr/data/#{ENV['RAILS_ENV']} -Djetty.port=#{SOLR_PORT} -jar start.jar"
        sleep(5)
        puts "#{ENV['RAILS_ENV']} Solr started sucessfuly on #{SOLR_PORT}, pid: #{pid}."
      end
    end
  end
</textarea>
<p>Just add this to vendor/plugins/acts_as_solr/lib/taks/solr.rake, and start solr server on windows by issuing </p>
<textarea name="code" class="ruby" cols="50" rows="10">
rake solr:start_win
</textarea>
]]></content:encoded>
			<wfw:commentRss>http://vinsol.com/blog/2007/09/13/acts_as_solr-starting-solr-server-on-windows/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

