fix for jruby from https://github.com/sunspot/sunspot/pull/267