lucene/client/ruby/solrb
Erik Hatcher 32d4ad8b3b Added author and page count to import. Adjusted schema to not stem or remove stop words.
git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@503377 13f79535-47bb-0310-9956-ffa450edef68
2007-02-04 09:39:55 +00:00
..
examples Added author and page count to import. Adjusted schema to not stem or remove stop words. 2007-02-04 09:39:55 +00:00
lib SOLR-134: Handle Time values using UTC + ISO 8691 representation (contributed by Coda Hale) 2007-02-02 04:33:21 +00:00
script Ruby solrshell 2007-02-03 03:45:31 +00:00
solr remove unnecessary bin directory 2007-02-03 07:37:25 +00:00
test Fix up requires so tests can run from TextMate, and of course still with rake 2007-02-03 07:36:54 +00:00
CHANGES.txt tidy up documentation and add license, preparing for an 0.01 release 2007-01-24 16:16:01 +00:00
LICENSE.txt Remove Solr specific licenses, leaving it with only ASL for solrb 2007-01-24 16:52:48 +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 cleanup of Rakefile, adding descriptions for all publicly desirable tasks 2007-01-30 06:05:21 +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>