fix searchworks_format_spec so it passes with jruby and is more efficient