You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-commits@lucene.apache.org by eh...@apache.org on 2007/01/15 03:43:03 UTC
svn commit: r496211 - /incubator/solr/trunk/client/ruby/solrb/README
Author: ehatcher
Date: Sun Jan 14 18:43:02 2007
New Revision: 496211
URL: http://svn.apache.org/viewvc?view=rev&rev=496211
Log:
Adjust README with current API
Modified:
incubator/solr/trunk/client/ruby/solrb/README
Modified: incubator/solr/trunk/client/ruby/solrb/README
URL: http://svn.apache.org/viewvc/incubator/solr/trunk/client/ruby/solrb/README?view=diff&rev=496211&r1=496210&r2=496211
==============================================================================
--- incubator/solr/trunk/client/ruby/solrb/README (original)
+++ incubator/solr/trunk/client/ruby/solrb/README Sun Jan 14 18:43:02 2007
@@ -1,42 +1,45 @@
solrb exposes the power of Solr as a Ruby DSL (domain specific language).
- Visit the Solr Flare wiki for more information: http://wiki.apache.org/solr/Flare
+ Visit the solrb wiki for more information: http://wiki.apache.org/solr/solrb
USAGE
First launch Solr.
-In a separate shell, launch script/console.
+ cd solr
+ java -jar start.jar
+
+In a separate shell, launch irb -Ilib.
+
+# Bring in the Solr library
+ require 'solr'
# Set up a connection to Solr:
- connection = Solr::Connection.new("http://localhost:8983")
+ connection = Solr::Connection.new 'http://localhost:8983/solr'
# To add a document:
- doc = {:id => "529", :text => "Solr Flare in Action"}
- request = Solr::AddDocumentRequest.new(doc)
+ doc = Solr::Document.new :id => '529', :text => 'Solr Flare in Action'
+ request = Solr::Request::AddDocument.new(doc)
connection.send(request)
-
+
# Commit changes:
- request = Solr::UpdateRequest.new("<commit/>") # TODO: yes, this will be mapped as a simpler command!
- connection.send(request)
+ connection.commit
# Search:
- request = Solr::StandardRequest.new
- request.query = "solr flare"
+ request = Solr::Request::Standard.new :query => 'solr flare'
connection.send(request)
-
INSTALLATION
First run the tests:
- rake test
-
+ rake
+
then build the gem:
rake package