lucene/client/ruby/solr-ruby
Koji Sekiguchi f4e41c8c8f SOLR-537: Use of hl.maxAlternateFieldLength parameter from solr-ruby
git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@657290 13f79535-47bb-0310-9956-ffa450edef68
2008-05-17 03:31:18 +00:00
..
examples add language values to Tang example 2007-08-22 12:06:30 +00:00
lib SOLR-537: Use of hl.maxAlternateFieldLength parameter from solr-ruby 2008-05-17 03:31:18 +00:00
script Rename solrb to solr-ruby. Long live solrb 2007-02-18 18:37:34 +00:00
solr/conf SOLR-342: Added support for Lucene's new index writer options 2008-03-05 20:23:36 +00:00
test SOLR-537: Use of hl.maxAlternateFieldLength parameter from solr-ruby 2008-05-17 03:31:18 +00:00
CHANGES.yml SOLR-492: Add facet.offset support to standard/dismax requests 2008-03-01 11:17:28 +00:00
LICENSE.txt Rename solrb to solr-ruby. Long live solrb 2007-02-18 18:37:34 +00:00
README Rename solrb -> solr-ruby 2007-02-19 02:20:25 +00:00
Rakefile Fix build to bundle in proper CHANGES file 2007-10-05 12:56:30 +00:00

README

solr-ruby exposes the power of Solr as a Ruby  DSL (domain specific language).

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

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>