lucene/client/ruby/solrb
Erik Hatcher bd3e81a1a8 add TODO discussion comment to ruby.rb
git-svn-id: https://svn.apache.org/repos/asf/incubator/solr/trunk@496953 13f79535-47bb-0310-9956-ffa450edef68
2007-01-17 07:55:00 +00:00
..
examples/marc Add more MARC mappings. Add a -debug switch to dump documents to stdout instead of sending to Solr 2007-01-16 18:06:18 +00:00
lib add TODO discussion comment to ruby.rb 2007-01-17 07:55:00 +00:00
solr allow facets and text fields to be multi-valued 2007-01-16 18:05:11 +00:00
test SOLR-111: add new response classes and enhance connection. one change i made was to make autocommit off by default and use a symbol for :on/:off 2007-01-16 22:02:13 +00:00
Changes sooner rather than later, tease the Solr DSL out from the web framework 2007-01-03 04:57:00 +00:00
README Update example to use _text field name and have explicit require/include code too, suitable for copy/pasting right into irb to work it, and cleaned up output 2007-01-17 05:44:37 +00:00
Rakefile Cosmetic change to gem summary 2007-01-15 01:44:37 +00:00

README

solrb exposes the power of Solr as a Ruby  DSL (domain specific language).

  Visit the solrb wiki for more information: http://wiki.apache.org/solr/solrb

USAGE 

First launch Solr:

  cd solr
  java -jar start.jar

In a separate shell, launch {{{irb -Ilib}}}:

  require 'solr'  # load the library
  include Solr    # Allow Solr:: to be omitted from class/module references

  # connect to the solr instance
  conn = Connection.new('http://localhost:8983/solr', :autocommit => :on)

  # add a document to the index
  conn.add(:id => 123, :title_text => 'Lucene in Action')

  # update the document
  conn.update(:id => 123, :title_text => 'Solr in Action')

  # print out the first hit in a query for 'action'
  response = conn.query('action')
  print response.hits[0]

  # iterate through all the hits for 'action'
  conn.query('action') do |hit|
    puts hit.inspect
  end

  # delete document by id
  conn.delete(123)

INSTALLATION

First run the tests:

  rake
  
then build the gem:

  rake package

and install the versioned gem:

  gem install pkg/solr-x.x.x.gem 

LICENSE

This package is licensed using the Apache Software License 2.0.

<http://www.apache.org/licenses/LICENSE-2.0>