[ANN] acts_as_solr v.0.9 has been released

It’s with great pleasure that I announce this great milestone for the
acts_as_solr plugin. Thanks to all who contributed with ideas,
patches, etc.

========= About =========
This plugin adds full text search capabilities and many other nifty
features from Apache’s Solr to any Rails model.

========= IMPORTANT: Before you Upgrade from v.0.8.5 =========
If you are currently using the embedded Solr in production
environment, please make sure you backup the data directory before
upgrading to version 0.9 because the directory where Solr lives now is
under acts_as_solr/solr instead of acts_as_solr/test/solr.

========= Changes ============
NEW: Added the option :scores when doing a search. If set to true this
will return the score as a ‘solr_score’ attribute or each one of the
instances found
books = Book.find_by_solr ‘ruby OR splinter’, :scores => true
books.records.first.solr_score
=> 1.21321397
books.records.last.solr_score
=> 0.12321548

NEW: Major change on the way the results returned are accessed.
books = Book.find_by_solr ‘ruby’

the above will return a SearchResults class with 4 methods:

docs|results|records: will return an array of records found

books.records.is_a?(Array)

=> true

total|num_found|total_hits: will return the total number of

records found

books.total

=> 2

facets: will return the facets when doing a faceted search

max_score|highest_score: returns the highest score found

books.max_score

=> 1.3213213

NEW: Integrating acts_as_solr to use solr-ruby as the ‘backend’.
Integration based on the patch submitted by Erik H.

NEW: Re-factoring rebuild_solr_index to allow adds to be done in
batch; and if a finder block is given, it will be called to retrieve
the items to index. (thanks Daniel E.)

NEW: Adding the option to specify the port Solr should start when
using rake solr:start
rake solr:start RAILS_ENV=your_env PORT=XX

NEW: Adding deprecation warning for the :background configuration
option. It will no longer be updated.

NEW: Adding support for models that use a primary key other than
integer
class Posting < ActiveRecord::Base
set_primary_key ‘guid’ #string
#make sure you set the :primary_key_field => ‘pk_s’ if you wish to
use a string field as the primary key
acts_as_solr({},{:primary_key_field => ‘pk_s’})
end

FIX: Disabling of storing most fields. Storage isn’t useful for
acts_as_solr in any field other than the pk and id fields. It just
takes up space and time. (thanks Daniel E.)

FIX: Re-factoring code submitted by Daniel E.

NEW: Adding an :auto_commit option that will only send the commit
command to Solr if it is set to true
class Author < ActiveRecord::Base
acts_as_solr :auto_commit => false
end

FIX: Fixing bug on rake’s test task

FIX: Making acts_as_solr’s Post class compatible with Solr 1.2 (thanks
Si)

NEW: Adding Solr 1.2

FIX: Removing Solr 1.1

NEW: Adding a conditional :if option to the acts_as_solr call. It
behaves the same way ActiveRecord’s :if argument option does.
class Electronic < ActiveRecord::Base
acts_as_solr :if => proc{|record| record.is_active?}
end

NEW: Adding fixtures to Solr index when using rake db:fixtures:load

FIX: Fixing boost warning messages

FIX: Fixing bug when adding a facet to a field that contains boost

NEW: Deprecating find_with_facet and combining functionality with
find_by_solr

NEW: Adding the option to :exclude_fields when indexing a model
class User < ActiveRecord::Base
acts_as_solr :exclude_fields =>
[:password, :login, :credit_card_number]
end

FIX: Fixing branch bug on older ruby version

NEW: Adding boost support for fields and documents being indexed:
class Electronic < ActiveRecord::Base
# You can add boosting on a per-field basis or on the entire
document
acts_as_solr :fields => [{:price => {:boost => 5.0}}], :boost =>
5.0
end

FIX: Fixed the acts_as_solr limitation to only accept test|development|
production environments.
========= /Changes ============

For more info:
http://acts_as_solr.railsfreaks.com
OR if your browser/isp can’t render:
http://acts-as-solr.railsfreaks.com


Thiago J.