# \[ANN\] acts\_as\_solr v.0.9 has been released

**URL:** <https://www.ruby-forum.com/t/ann-acts-as-solr-v-0-9-has-been-released/107149>\
**Category:** Rails\
**Created:** [June 18, 2007, 4:23pm UTC](https://www.ruby-forum.com/t/ann-acts-as-solr-v-0-9-has-been-released/107149 "2007-06-18T16:23:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thiago\_J](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/58956e/32.png) [@Thiago\_J](https://www.ruby-forum.com/u/Thiago_J)\
**Post date:** [June 18, 2007, 4:23pm UTC](https://www.ruby-forum.com/t/ann-acts-as-solr-v-0-9-has-been-released/107149/1 "2007-06-18T16:23:15Z")

</div>

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](http://acts-as-solr.railsfreaks.com)

–  
Thiago J.
