github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

avvo / delsolr

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 17
    • 1
  • Source
  • Commits
  • Network (1)
  • Issues (0)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (0)
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

Ruby wrapper for Lucene Solr — Read more

  cancel

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

Adding comment for new :path option 
Ben VandenBos (author)
Tue Nov 03 09:55:35 -0800 2009
commit  06d6b80288e16d8c716447303dbc11bf7ea8b169
tree    e2d3c1b9ec61bf0c9b01d92fc5997fd612984f2b
parent  2648cbc415c0d2293a2c623cc903f40639632e99
delsolr /
name age
history
message
file .gitignore Mon Sep 08 14:17:05 -0700 2008 initial commit [bvandenbos]
file License.txt Mon Sep 08 14:17:05 -0700 2008 initial commit [bvandenbos]
file README.txt Tue Nov 03 08:47:10 -0800 2009 updating readme [Ben VandenBos]
file Rakefile Mon Nov 02 22:46:02 -0800 2009 Moving gem from rubyforge to github and removin... [Ben VandenBos]
file delsolr.gemspec Tue Nov 03 09:16:20 -0800 2009 Adding an option :path option to DelSolr::Clien... [Ben VandenBos]
file init.rb Tue Nov 03 08:42:58 -0800 2009 Moving init.rb to project root, removing rails dir [Ben VandenBos]
directory lib/ Tue Nov 03 09:55:35 -0800 2009 Adding comment for new :path option [Ben VandenBos]
directory test/ Tue Nov 03 09:16:20 -0800 2009 Adding an option :path option to DelSolr::Clien... [Ben VandenBos]
README.txt
= delsolr

http://delsolr.rubyforge.org

== DESCRIPTION:

DelSolr is a light weight ruby wrapper for solr.  It's intention is to expose the full power of solr queries 
while keeping the interface as ruby-esque as possible.

== Installation

Can be installed as a gem which is hosted on http://gemcutter.org

    gem install delsolr

or as a plugin...

    ruby script/plugin install git://github.com/avvo/delsolr.git


== PROBLEMS:

* Not threadsafe yet

== SYNOPSIS:

See http://delsolr.rubyforge.org for more info

Example:

    c = DelSolr::Client.new(:server => 'solr1', :port => 8983)
    rsp = c.query('dismax', :query => 'mp3 player',
                            :filters => {:cost => (50..100)},
                            :facets => [{:field => 'brand', :limit => 10},
                                        {:query => {:onsale => true, :brand => 'Apple'},
                                         :name => 'cheap_apple'}])

    # output total matches
    puts rsp.total

    # output each id with score
    rsp.docs.each { |doc| puts "#{doc[:id]} - #{doc[:score]}" }

    # output each value for a facet
    rsp.facet_field_values('brand').each do |brand|
      puts "#{brand}: #{rsp.facet_field_count('brand', brand}"
    end

    # output a query facet
    puts "Cheap Apple stuff: #{rsp.facet_query_count_by_name('cheap_apple')}"

    # adding things
    doc = DelSolr::Document.new
    doc.add_field('id', 'ABC-123')
    doc.add_field('name', '8 Gig Shuffle')
    doc.add_field('description', 'A crazy-tiny MP3 player')
    c.update!(doc) # posts new document to solr
    c.commit! # posts a commit to solr

    rsp = c.query('dismax', :query => 'shuffle mp3 player')
    puts rsp.ids[0]


== REQUIREMENTS:

You need Solr installed somewhere so you can query it ;)

== INSTALL:

sudo gem install delsolr

== TODO:

 * implement delete_by_query
 * make thread safe
   * it would be nice to be able to have things like commit/optimize be ran in threads on timers periodically
   * right now a few things need to be locked
     * connection
     * pending_documents array


== LICENSE:

(The MIT License)

Copyright (c) 2008 Avvo, INC - http://www.avvo.com

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server