forked from tjackiw/acts_as_solr
-
Notifications
You must be signed in to change notification settings - Fork 1
/
CHANGE_LOG
217 lines (179 loc) · 10.6 KB
/
CHANGE_LOG
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
== CHANGE_LOG
=== 06-18-2007: Version 0.9
<b>NEW</b>:: 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
<b>NEW</b>:: 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
<b>NEW</b>:: Integrating acts_as_solr to use solr-ruby as the 'backend'. Integration based on the patch submitted by Erik Hatcher
<b>NEW</b>:: 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.)
<b>NEW</b>:: Adding the option to specify the port Solr should start when using rake solr:start
rake solr:start RAILS_ENV=your_env PORT=XX
<b>NEW</b>:: Adding deprecation warning for the :background configuration option. It will no longer be updated.
<b>NEW</b>:: 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
<b>FIX</b>:: 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.)
<b>FIX</b>:: Re-factoring code submitted by Daniel E.
<b>NEW</b>:: 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
<b>FIX</b>:: Fixing bug on rake's test task
<b>FIX</b>:: Making acts_as_solr's Post class compatible with Solr 1.2 (thanks Si)
<b>NEW</b>:: Adding Solr 1.2
<b>FIX</b>:: Removing Solr 1.1
<b>NEW</b>:: 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
<b>NEW</b>:: Adding fixtures to Solr index when using rake db:fixtures:load
<b>FIX</b>:: Fixing boost warning messages
<b>FIX</b>:: Fixing bug when adding a facet to a field that contains boost
<b>NEW</b>:: Deprecating find_with_facet and combining functionality with find_by_solr
<b>NEW</b>:: 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
<b>FIX</b>:: Fixing branch bug on older ruby version
<b>NEW</b>:: 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
<b>FIX</b>:: Fixed the acts_as_solr limitation to only accept test|development|production environments.
=== 05-16-2007: Version 0.8.5
<b>FIX</b>:: There's no need to specify the :field_types anymore when doing a search in a model that specifies a field type for a field.
<b>FIX</b>:: Better handling of nil values from indexed fields. Solr complained when indexing fields with field type and the field values being passed as nils.
<b>NEW</b>:: Adding Solr sort (order by) option to the search query (thanks Kevin Hunt)
<b>FIX</b>:: Applying patch suggested for increasing the Solr commit speed (thanks Mourad Hammiche)
<b>FIX</b>:: Updated documentation
=== 05-10-2007: Version 0.8
<b>NEW</b>: New video tutorial
<b>NEW</b>: Faceted search has been implemented and its possible to 'drill-down' on the facets
<b>NEW</b>: New rake tasks you can use to start/stop the solr server in test, development and production environments: (thanks Matt Clark)
rake solr:start|stop RAILS_ENV=test|development|production (defaults to development if none given)
<b>NEW</b>: Changes to the plugin's test framework and it now supports Sqlite as well (thanks Matt Clark)
<b>FIX</b>: Patch applied (thanks Micah) that allows one to have multiple solr instances in the same servlet
<b>FIX</b>: Patch applied (thanks Micah) that allows indexing of STIs
<b>FIX</b>: Patch applied (thanks Gordon) that allows the plugin to use a table's primary key different than 'id'
<b>FIX</b>: Returning empty array instead of empty strings when no records are found
<b>FIX</b>: Problem with unit tests failing due to order of the tests and speed of the commits
=== 02-16-2007: Version 0.7
<b>NEW</b>: You can now specify the field types when indexing and searching if
you'd like to preserve its original type:
<b>Indexing</b>
Each field passed can also be a hash with the value being a field type
class Electronic < ActiveRecord::Base
acts_as_solr :fields => [{:price => :range_float}, {:current_time => :date}]
def current_time
Time.now
end
end
<b>Searching</b>
Electronic.find_by_solr "ipod AND price:[* TO 59.99]",
:field_types => [{:price => :range_float}]
The field types accepted are:
<em>:float</em>:: Index the field value as a float (ie.: 12.87)
<em>:integer</em>:: Index the field value as an integer (ie.: 31)
<em>:boolean</em>:: Index the field value as a boolean (ie.: true/false)
<em>:date</em>:: Index the field value as a date (ie.: Wed Nov 15 23:13:03 PST 2006)
<em>:string</em>:: Index the field value as a text string, not applying the same indexing filters as a regular text field
<em>:range_integer</em>:: Index the field value for integer range queries (ie.:[5 TO 20])
<em>:range_float</em>:: Index the field value for float range queries (ie.:[14.56 TO 19.99])
<b>Setting the field type preserves its original type when indexed</b>
<b>FIX</b>: Fixing sorting bug. Thanks for the catch Laurel
<b>FIX</b>: Fixing small bug when installing the plugin
<b>NEW</b>: Adding the :additional_fields option to the acts_as_solr method
=== 02-05-2007: Version 0.6.5
<b>NEW</b>:: Added multi-model search, which can be used to execute a search across multiple models:
Book.multi_solr_search "Napoleon OR Tom", :models => [Movie]
====options:
Accepts the same options as find_by_solr plus:
models:: The additional models you'd like to include in the search
results_format:: Specify the format of the results found
:objects :: Will return an array with the results being objects (default). Example:
Book.multi_solr_search "Napoleon OR Tom", :models => [Movie], :results_format => :objects
:ids :: Will return an array with the ids of each entry found. Example:
Book.multi_solr_search "Napoleon OR Tom", :models => [Movie], :results_format => :ids
=> [{"id" => "Movie:1"},{"id" => Book:1}]
Where the value of each array is as Model:instance_id
=== 02-03-2007: Version 0.6
<b>NEW</b>:: Added basic faceted search functionality for indexing and searching:
==== Indexing:
class Electronic < ActiveRecord::Base
acts_as_solr :facets => [:category, :manufacturer]
end
==== Searching:
Electronic.find_with_facet "memory", :facets => {:fields =>[:category]}
=== 01-15-2007: Version 0.5
<b>NEW</b>:: Added model association indexing, which means you can include any :has_one, :has_many,
:belongs_to and :has_and_belongs_to_many association to be indexed:
class Category < ActiveRecord::Base
has_many :books
acts_as_solr :include => [:books]
end
class Book < ActiveRecord::Base
belongs_to :category
acts_as_solr :include => [:category]
end
=== 01-11-2007:
<b>NEW</b>:: Added the acts_as_solr's plugin tests
=== 11-07-2006: Version 0.4
<b>NEW</b>:: Added :background option, which takes and integer value (in minutes) to wait before committing the changes to Solr. This depends on rail_cron being installed. By setting up the background job we prevent the users from having to wait for Solr records to be created, and we keep from updating the index over and over for quickly successive changes. (Rob Kaufman)
=== 11-02-2006: Version 0.3
<b>NEW</b>:: Added a method (Model.count_by_solr) that returns the total number of documents found based on query passed
<b>NEW</b>:: Added configuration for production and development environments
=== 10-21-2006: Version 0.2
<b>PLUGIN</b>
<b>FIX</b>:: Fixed bug when mixing search-by-field and 'free' search: Model.find_by_solr 'solr AND name:Thiago'
<b>FIX</b>:: Fixed bug with multi-terms search: Book.find_by_solr 'anteater john'
<b>FIX</b>:: Fixed bug when including more than one search field: Model.find_by_solr 'name:Thiago AND engine:Solr'
<b>FIX</b>:: Fixed bug when rebuilding the index, it wasn't saving the data
<b>NEW</b>:: Added the ability to index custom methods from a model as search fields
<b>NEW</b>:: Added a search method (Model.find_id_by_solr) that will return only the id of the results
<b>SCHEMA.XML</b>
<b>NEW</b>:: Added a new field: <field name="default" type="text" indexed="true" stored="true" />
<b>NEW</b>:: Added a default search field: <defaultSearchField>default</defaultSearchField>
<b>FIX</b>:: Changed the defaultOperator to AND instead of OR
=== 09-29-2006: Version 0.1
<b>PLUGIN</b>
<b>NEW</b>:: Included the option of having a Solr config file inside the rails env.
<b>NEW</b>:: Added the ability of indexing only certain fields, if you chose to.
<b>NEW</b>:: Added configuration options
<b>NEW</b>:: Changed the way the search was done:
Old: You were forced the specify the field you wanted to look for
('field:value') and you had to specify a default search field as
well, for when you didn't include the 'field' in the search term
New: The new search features include:
- You don't have to specify a default search field;
- You are not forced to include the field name in the search term,
unless you choose to search for a specific field ('name:Thiago');
- You can pass the starting row and the number of rows per page,
which is usefull for pagination
<b>NEW</b>:: Included a method to rebuild the index files
<b>SCHEMA.XML</b>
<b>NEW</b>:: Created an optimized version of the config file to better work with this plugin