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 Apache Wiki <wi...@apache.org> on 2007/01/03 14:55:34 UTC

[Solr Wiki] Update of "solrb" by ErikHatcher

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Solr Wiki" for change notification.

The following page has been changed by ErikHatcher:
http://wiki.apache.org/solr/solrb

New page:
== Trying out solrb ==
 * Check out solrb {{{svn co http://svn.apache.org/repos/asf/incubator/solr/trunk/client/ruby/solrb}}}
 * {{{cd solrb/solr}}}
 * Launch Solr: {{{java -jar start.jar}}}
 * (in a separate shell) Launch IRB: {{{cd solrb ; irb -Ilib}}}
 * Try out the commands below:

Set up a connection to Solr:
{{{
  connection = Solr::Connection.new("http://localhost:8983")
}}}

To add a document:
{{{
  doc = {:id => "529", :text => "Solr Flare in Action"}
  request = Solr::AddDocumentRequest.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)
}}}

Search:
{{{
  request = Solr::StandardRequest.new  
  request.query = "solr flare"
  connection.send(request)
}}}