Skip to content

Instantly share code, notes, and snippets.

@mwmitchell
Created February 5, 2010 19:17
Show Gist options
  • Save mwmitchell/296111 to your computer and use it in GitHub Desktop.
Save mwmitchell/296111 to your computer and use it in GitHub Desktop.
require 'java'
require 'rubygems'
require 'rsolr'
require 'rsolr-direct'
RSolr.load_java_libs
import java.io.ByteArrayInputStream
import org.apache.solr.common.util.JavaBinCodec
rsolr = RSolr.connect
response = rsolr.select(:q => '*:*', :wt => :javabin)
stream = ByteArrayInputStream.new(response.to_java_bytes)
map = JavaBinCodec.new.unmarshal(stream)
puts map.inspect
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment