0.01
No commit activity in last 3 years
No release in over 3 years
Provides a non-http connection to your solr/lucene index
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 1.2.9

Runtime

>= 1.0.0
 Project Readme

rsolr-direct¶ ↑

rsolr-direct enhances the RSolr core library by adding the ability to connect to Solr directly, using JRuby, sans http. Hotdog!

How¶ ↑

Check out the specs to see the various connection methods.

Solr Java libs/jars¶ ↑

You’ll need to make sure you have the proper jars loaded. Use RSolr::Direct #load_java_libs for this if you’d like:

require 'rsolr-direct'
RSolr::Direct.load_java_libs "path/to/solr/distribution"
# create connection etc..

The path/to/solr/distribution should be a directory containing “lib” and “dist” – a typical solr download will do.

:solr_home¶ ↑

require 'rsolr-direct'
connection = RSolr.direct_connect(
  :solr_home => '/absolute/path/to/solr/home',
  :data_dir => "/optional/path/to/data/dir")

Java::OrgApacheSolrCore::SolrCore¶ ↑

require 'rsolr-direct'
core = org.apache.solr.core.SolrCore.new(nil, solr_data_path, solr_config, index_schema, dcore)
connection = RSolr.direct_connect core

Java::OrgApacheSolrServlet::DirectSolrConnection¶ ↑

require 'rsolr-direct'
dc = org.apache.solr.servlet.DirectSolrConnection.new(solr_home_path, solr_data_path, solr_log_path)
connection = RSolr.direct_connect dc

Why¶ ↑

Using a direct connection to Solr can speed up indexing. How much faster? This document says ~ 50% => wiki.apache.org/solr/SolrPerformanceFactors#Embedded_vs_HTTP_Post

Testing¶ ↑

Clone it, cd into the project dir and run:

jruby -S rake spec
  • note, rspec 1.3 is required.

Note on Patches/Pull Requests¶ ↑

  • Fork the project.

  • Make your feature addition or bug fix.

  • Add tests for it. This is important so I don’t break it in a future version unintentionally.

  • Commit, do not mess with rakefile, version, or history (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)

  • Send me a pull request. Bonus points for topic branches.

Copyright © 2010 Matt Mitchell. See LICENSE for details.