warp-thinking-sphinx 1.2.12 → 1.3.10
Sign up to get free protection for your applications and to get access to all the features.
- data/README.textile +21 -4
- data/VERSION +1 -0
- data/features/abstract_inheritance.feature +10 -0
- data/features/alternate_primary_key.feature +1 -1
- data/features/attribute_updates.feature +22 -5
- data/features/deleting_instances.feature +3 -0
- data/features/facets.feature +6 -0
- data/features/facets_across_model.feature +2 -2
- data/features/searching_across_models.feature +1 -1
- data/features/searching_by_index.feature +40 -0
- data/features/sphinx_scopes.feature +7 -0
- data/features/step_definitions/alpha_steps.rb +14 -1
- data/features/step_definitions/beta_steps.rb +1 -1
- data/features/step_definitions/common_steps.rb +12 -2
- data/features/step_definitions/facet_steps.rb +5 -1
- data/features/step_definitions/scope_steps.rb +4 -0
- data/features/step_definitions/sphinx_steps.rb +8 -4
- data/features/sti_searching.feature +5 -0
- data/features/support/{db/database.example.yml → database.example.yml} +0 -0
- data/features/support/db/fixtures/foxes.rb +3 -0
- data/features/support/db/fixtures/music.rb +4 -0
- data/features/support/db/fixtures/robots.rb +1 -1
- data/features/support/db/fixtures/tags.rb +1 -1
- data/features/support/db/migrations/create_alphas.rb +1 -0
- data/features/support/db/migrations/create_genres.rb +3 -0
- data/features/support/db/migrations/create_music.rb +6 -0
- data/features/support/db/migrations/create_robots.rb +1 -2
- data/features/support/env.rb +16 -1
- data/features/support/models/alpha.rb +12 -0
- data/features/support/models/comment.rb +3 -3
- data/features/support/models/fox.rb +5 -0
- data/features/support/models/genre.rb +3 -0
- data/features/support/models/medium.rb +5 -0
- data/features/support/models/music.rb +8 -0
- data/features/support/models/post.rb +2 -1
- data/features/support/models/robot.rb +4 -0
- data/lib/cucumber/thinking_sphinx/external_world.rb +8 -0
- data/lib/cucumber/thinking_sphinx/internal_world.rb +126 -0
- data/lib/cucumber/thinking_sphinx/sql_logger.rb +20 -0
- data/lib/thinking_sphinx.rb +56 -37
- data/lib/thinking_sphinx/active_record.rb +257 -192
- data/lib/thinking_sphinx/active_record/attribute_updates.rb +10 -12
- data/lib/thinking_sphinx/active_record/delta.rb +0 -26
- data/lib/thinking_sphinx/active_record/scopes.rb +37 -1
- data/lib/thinking_sphinx/adapters/mysql_adapter.rb +1 -1
- data/lib/thinking_sphinx/adapters/postgresql_adapter.rb +18 -11
- data/lib/thinking_sphinx/attribute.rb +19 -4
- data/lib/thinking_sphinx/auto_version.rb +22 -0
- data/lib/thinking_sphinx/configuration.rb +57 -59
- data/lib/thinking_sphinx/context.rb +74 -0
- data/lib/thinking_sphinx/deltas.rb +0 -2
- data/lib/thinking_sphinx/deltas/default_delta.rb +14 -20
- data/lib/thinking_sphinx/deploy/capistrano.rb +1 -1
- data/lib/thinking_sphinx/facet_search.rb +3 -1
- data/lib/thinking_sphinx/index.rb +77 -19
- data/lib/thinking_sphinx/index/builder.rb +2 -2
- data/lib/thinking_sphinx/search.rb +47 -9
- data/lib/thinking_sphinx/search_methods.rb +22 -4
- data/lib/thinking_sphinx/source.rb +9 -8
- data/lib/thinking_sphinx/source/sql.rb +5 -3
- data/lib/thinking_sphinx/tasks.rb +13 -57
- data/lib/thinking_sphinx/test.rb +52 -0
- data/rails/init.rb +4 -2
- data/spec/{lib/thinking_sphinx → thinking_sphinx}/active_record/delta_spec.rb +4 -6
- data/spec/{lib/thinking_sphinx → thinking_sphinx}/active_record/has_many_association_spec.rb +0 -0
- data/spec/thinking_sphinx/active_record/scopes_spec.rb +177 -0
- data/spec/thinking_sphinx/active_record_spec.rb +622 -0
- data/spec/{lib/thinking_sphinx → thinking_sphinx}/association_spec.rb +0 -0
- data/spec/{lib/thinking_sphinx → thinking_sphinx}/attribute_spec.rb +39 -0
- data/spec/thinking_sphinx/auto_version_spec.rb +39 -0
- data/spec/{lib/thinking_sphinx → thinking_sphinx}/configuration_spec.rb +27 -61
- data/spec/thinking_sphinx/context_spec.rb +119 -0
- data/spec/{lib/thinking_sphinx → thinking_sphinx}/core/array_spec.rb +0 -0
- data/spec/{lib/thinking_sphinx → thinking_sphinx}/core/string_spec.rb +0 -0
- data/spec/{lib/thinking_sphinx → thinking_sphinx}/excerpter_spec.rb +0 -0
- data/spec/{lib/thinking_sphinx → thinking_sphinx}/facet_search_spec.rb +0 -0
- data/spec/{lib/thinking_sphinx → thinking_sphinx}/facet_spec.rb +0 -0
- data/spec/{lib/thinking_sphinx → thinking_sphinx}/field_spec.rb +0 -0
- data/spec/{lib/thinking_sphinx → thinking_sphinx}/index/builder_spec.rb +24 -0
- data/spec/{lib/thinking_sphinx → thinking_sphinx}/index/faux_column_spec.rb +0 -0
- data/spec/thinking_sphinx/index_spec.rb +183 -0
- data/spec/{lib/thinking_sphinx → thinking_sphinx}/rails_additions_spec.rb +0 -0
- data/spec/{lib/thinking_sphinx → thinking_sphinx}/search_methods_spec.rb +0 -0
- data/spec/{lib/thinking_sphinx → thinking_sphinx}/search_spec.rb +41 -0
- data/spec/{lib/thinking_sphinx → thinking_sphinx}/source_spec.rb +1 -1
- data/spec/thinking_sphinx_spec.rb +204 -0
- data/tasks/distribution.rb +6 -20
- data/tasks/testing.rb +8 -19
- metadata +117 -142
- data/VERSION.yml +0 -4
- data/features/a.rb +0 -17
- data/features/datetime_deltas.feature +0 -66
- data/features/delayed_delta_indexing.feature +0 -37
- data/features/step_definitions/datetime_delta_steps.rb +0 -15
- data/features/step_definitions/delayed_delta_indexing_steps.rb +0 -7
- data/features/support/db/active_record.rb +0 -40
- data/features/support/db/fixtures/delayed_betas.rb +0 -10
- data/features/support/db/fixtures/thetas.rb +0 -10
- data/features/support/db/migrations/create_delayed_betas.rb +0 -17
- data/features/support/db/migrations/create_thetas.rb +0 -5
- data/features/support/db/mysql.rb +0 -3
- data/features/support/db/postgresql.rb +0 -3
- data/features/support/models/delayed_beta.rb +0 -7
- data/features/support/models/theta.rb +0 -7
- data/features/support/post_database.rb +0 -43
- data/features/support/z.rb +0 -19
- data/lib/thinking_sphinx/deltas/datetime_delta.rb +0 -50
- data/lib/thinking_sphinx/deltas/delayed_delta.rb +0 -30
- data/lib/thinking_sphinx/deltas/delayed_delta/delta_job.rb +0 -24
- data/lib/thinking_sphinx/deltas/delayed_delta/flag_as_deleted_job.rb +0 -27
- data/lib/thinking_sphinx/deltas/delayed_delta/job.rb +0 -26
- data/spec/lib/thinking_sphinx/active_record/scopes_spec.rb +0 -96
- data/spec/lib/thinking_sphinx/active_record_spec.rb +0 -353
- data/spec/lib/thinking_sphinx/deltas/job_spec.rb +0 -32
- data/spec/lib/thinking_sphinx/index_spec.rb +0 -45
- data/spec/lib/thinking_sphinx_spec.rb +0 -162
- data/vendor/after_commit/LICENSE +0 -20
- data/vendor/after_commit/README +0 -16
- data/vendor/after_commit/Rakefile +0 -22
- data/vendor/after_commit/init.rb +0 -8
- data/vendor/after_commit/lib/after_commit.rb +0 -45
- data/vendor/after_commit/lib/after_commit/active_record.rb +0 -114
- data/vendor/after_commit/lib/after_commit/connection_adapters.rb +0 -103
- data/vendor/after_commit/test/after_commit_test.rb +0 -53
- data/vendor/delayed_job/lib/delayed/job.rb +0 -251
- data/vendor/delayed_job/lib/delayed/message_sending.rb +0 -7
- data/vendor/delayed_job/lib/delayed/performable_method.rb +0 -55
- data/vendor/delayed_job/lib/delayed/worker.rb +0 -54
- data/vendor/riddle/lib/riddle.rb +0 -30
- data/vendor/riddle/lib/riddle/client.rb +0 -635
- data/vendor/riddle/lib/riddle/client/filter.rb +0 -53
- data/vendor/riddle/lib/riddle/client/message.rb +0 -66
- data/vendor/riddle/lib/riddle/client/response.rb +0 -84
- data/vendor/riddle/lib/riddle/configuration.rb +0 -33
- data/vendor/riddle/lib/riddle/configuration/distributed_index.rb +0 -48
- data/vendor/riddle/lib/riddle/configuration/index.rb +0 -142
- data/vendor/riddle/lib/riddle/configuration/indexer.rb +0 -19
- data/vendor/riddle/lib/riddle/configuration/remote_index.rb +0 -17
- data/vendor/riddle/lib/riddle/configuration/searchd.rb +0 -25
- data/vendor/riddle/lib/riddle/configuration/section.rb +0 -43
- data/vendor/riddle/lib/riddle/configuration/source.rb +0 -23
- data/vendor/riddle/lib/riddle/configuration/sql_source.rb +0 -34
- data/vendor/riddle/lib/riddle/configuration/xml_source.rb +0 -28
- data/vendor/riddle/lib/riddle/controller.rb +0 -53
File without changes
|
File without changes
|
@@ -302,6 +302,23 @@ describe ThinkingSphinx::Search do
|
|
302
302
|
@client.match_mode.should == :extended2
|
303
303
|
end
|
304
304
|
end
|
305
|
+
|
306
|
+
describe 'sphinx_select' do
|
307
|
+
it "should default to *" do
|
308
|
+
ThinkingSphinx::Search.new.first
|
309
|
+
|
310
|
+
@client.select.should == "*"
|
311
|
+
end
|
312
|
+
|
313
|
+
it "should get set on the client if specified" do
|
314
|
+
ThinkingSphinx::Search.new('general',
|
315
|
+
:sphinx_select => "*, foo as bar"
|
316
|
+
).first
|
317
|
+
|
318
|
+
@client.select.should == "*, foo as bar"
|
319
|
+
end
|
320
|
+
|
321
|
+
end
|
305
322
|
|
306
323
|
describe 'pagination' do
|
307
324
|
it "should set the limit using per_page" do
|
@@ -816,6 +833,10 @@ describe ThinkingSphinx::Search do
|
|
816
833
|
:per_page => 30, :limit => 40
|
817
834
|
).per_page.should == 40
|
818
835
|
end
|
836
|
+
|
837
|
+
it "should allow for string arguments" do
|
838
|
+
ThinkingSphinx::Search.new(:per_page => '10').per_page.should == 10
|
839
|
+
end
|
819
840
|
end
|
820
841
|
|
821
842
|
describe '#total_pages' do
|
@@ -834,6 +855,14 @@ describe ThinkingSphinx::Search do
|
|
834
855
|
|
835
856
|
ThinkingSphinx::Search.new.total_pages.should == 2
|
836
857
|
end
|
858
|
+
|
859
|
+
it "should return 0 if there is no index and therefore no results" do
|
860
|
+
@client.stub!(:query => {
|
861
|
+
:matches => [], :total_found => nil, :total => nil
|
862
|
+
})
|
863
|
+
|
864
|
+
ThinkingSphinx::Search.new.total_pages.should == 0
|
865
|
+
end
|
837
866
|
end
|
838
867
|
|
839
868
|
describe '#next_page' do
|
@@ -860,6 +889,14 @@ describe ThinkingSphinx::Search do
|
|
860
889
|
it "should return the total number of results, not just the amount on the page" do
|
861
890
|
ThinkingSphinx::Search.new.total_entries.should == 41
|
862
891
|
end
|
892
|
+
|
893
|
+
it "should return 0 if there is no index and therefore no results" do
|
894
|
+
@client.stub!(:query => {
|
895
|
+
:matches => [], :total_found => nil
|
896
|
+
})
|
897
|
+
|
898
|
+
ThinkingSphinx::Search.new.total_entries.should == 0
|
899
|
+
end
|
863
900
|
end
|
864
901
|
|
865
902
|
describe '#offset' do
|
@@ -870,6 +907,10 @@ describe ThinkingSphinx::Search do
|
|
870
907
|
it "should increase by the per_page value for each page in" do
|
871
908
|
ThinkingSphinx::Search.new(:per_page => 25, :page => 2).offset.should == 25
|
872
909
|
end
|
910
|
+
|
911
|
+
it "should prioritise explicit :offset over calculated if given" do
|
912
|
+
ThinkingSphinx::Search.new(:offset => 5).offset.should == 5
|
913
|
+
end
|
873
914
|
end
|
874
915
|
|
875
916
|
describe '#indexes' do
|
@@ -161,7 +161,7 @@ describe ThinkingSphinx::Source do
|
|
161
161
|
end
|
162
162
|
|
163
163
|
it "should filter the primary key with the offset" do
|
164
|
-
model_count = ThinkingSphinx.indexed_models.size
|
164
|
+
model_count = ThinkingSphinx.context.indexed_models.size
|
165
165
|
@query.should match(/WHERE `id` = \(\(\$id - 1\) \/ #{model_count}\)/)
|
166
166
|
end
|
167
167
|
end
|
@@ -0,0 +1,204 @@
|
|
1
|
+
require 'spec/spec_helper'
|
2
|
+
|
3
|
+
describe ThinkingSphinx do
|
4
|
+
describe '.context' do
|
5
|
+
it "should return a Context instance" do
|
6
|
+
ThinkingSphinx.context.should be_a(ThinkingSphinx::Context)
|
7
|
+
end
|
8
|
+
|
9
|
+
it "should remember changes to the Context instance" do
|
10
|
+
models = ThinkingSphinx.context.indexed_models
|
11
|
+
|
12
|
+
ThinkingSphinx.context.indexed_models.replace([:model])
|
13
|
+
ThinkingSphinx.context.indexed_models.should == [:model]
|
14
|
+
|
15
|
+
ThinkingSphinx.context.indexed_models.replace(models)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
describe '.reset_context!' do
|
20
|
+
it "should remove the existing Context instance" do
|
21
|
+
existing = ThinkingSphinx.context
|
22
|
+
|
23
|
+
ThinkingSphinx.reset_context!
|
24
|
+
ThinkingSphinx.context.should_not == existing
|
25
|
+
|
26
|
+
Thread.current[:thinking_sphinx_context] = existing
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
describe '.define_indexes?' do
|
31
|
+
it "should define indexes by default" do
|
32
|
+
ThinkingSphinx.define_indexes?.should be_true
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
describe '.define_indexes=' do
|
37
|
+
it "should disable index definition" do
|
38
|
+
ThinkingSphinx.define_indexes = false
|
39
|
+
ThinkingSphinx.define_indexes?.should be_false
|
40
|
+
end
|
41
|
+
|
42
|
+
it "should enable index definition" do
|
43
|
+
ThinkingSphinx.define_indexes = false
|
44
|
+
ThinkingSphinx.define_indexes?.should be_false
|
45
|
+
ThinkingSphinx.define_indexes = true
|
46
|
+
ThinkingSphinx.define_indexes?.should be_true
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
describe '.deltas_enabled?' do
|
51
|
+
it "should index deltas by default" do
|
52
|
+
ThinkingSphinx.deltas_enabled = nil
|
53
|
+
ThinkingSphinx.deltas_enabled?.should be_true
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
describe '.deltas_enabled=' do
|
58
|
+
it "should disable delta indexing" do
|
59
|
+
ThinkingSphinx.deltas_enabled = false
|
60
|
+
ThinkingSphinx.deltas_enabled?.should be_false
|
61
|
+
end
|
62
|
+
|
63
|
+
it "should enable delta indexing" do
|
64
|
+
ThinkingSphinx.deltas_enabled = false
|
65
|
+
ThinkingSphinx.deltas_enabled?.should be_false
|
66
|
+
ThinkingSphinx.deltas_enabled = true
|
67
|
+
ThinkingSphinx.deltas_enabled?.should be_true
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
describe '.updates_enabled?' do
|
72
|
+
it "should update indexes by default" do
|
73
|
+
ThinkingSphinx.updates_enabled = nil
|
74
|
+
ThinkingSphinx.updates_enabled?.should be_true
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
describe '.updates_enabled=' do
|
79
|
+
it "should disable index updating" do
|
80
|
+
ThinkingSphinx.updates_enabled = false
|
81
|
+
ThinkingSphinx.updates_enabled?.should be_false
|
82
|
+
end
|
83
|
+
|
84
|
+
it "should enable index updating" do
|
85
|
+
ThinkingSphinx.updates_enabled = false
|
86
|
+
ThinkingSphinx.updates_enabled?.should be_false
|
87
|
+
ThinkingSphinx.updates_enabled = true
|
88
|
+
ThinkingSphinx.updates_enabled?.should be_true
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
describe '.sphinx_running?' do
|
93
|
+
it "should always say Sphinx is running if flagged as being on a remote machine" do
|
94
|
+
ThinkingSphinx.remote_sphinx = true
|
95
|
+
ThinkingSphinx.stub!(:sphinx_running_by_pid? => false)
|
96
|
+
|
97
|
+
ThinkingSphinx.sphinx_running?.should be_true
|
98
|
+
end
|
99
|
+
|
100
|
+
it "should actually pay attention to Sphinx if not on a remote machine" do
|
101
|
+
ThinkingSphinx.remote_sphinx = false
|
102
|
+
ThinkingSphinx.stub!(:sphinx_running_by_pid? => false)
|
103
|
+
ThinkingSphinx.sphinx_running?.should be_false
|
104
|
+
|
105
|
+
ThinkingSphinx.stub!(:sphinx_running_by_pid? => true)
|
106
|
+
ThinkingSphinx.sphinx_running?.should be_true
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
110
|
+
describe '.version' do
|
111
|
+
it "should return the version from the stored YAML file" do
|
112
|
+
version = Jeweler::VersionHelper.new(
|
113
|
+
File.join(File.dirname(__FILE__), '..')
|
114
|
+
).to_s
|
115
|
+
|
116
|
+
ThinkingSphinx.version.should == version
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
120
|
+
describe "use_group_by_shortcut? method" do
|
121
|
+
before :each do
|
122
|
+
adapter = defined?(JRUBY_VERSION) ? :JdbcAdapter : :MysqlAdapter
|
123
|
+
unless ::ActiveRecord::ConnectionAdapters.const_defined?(adapter)
|
124
|
+
pending "No MySQL"
|
125
|
+
return
|
126
|
+
end
|
127
|
+
|
128
|
+
@connection = stub('adapter',
|
129
|
+
:select_all => true,
|
130
|
+
:class => ActiveRecord::ConnectionAdapters::MysqlAdapter,
|
131
|
+
:config => {:adapter => defined?(JRUBY_VERSION) ? 'jdbcmysql' : 'mysql'}
|
132
|
+
)
|
133
|
+
::ActiveRecord::Base.stub!(
|
134
|
+
:connection => @connection
|
135
|
+
)
|
136
|
+
|
137
|
+
Thread.current[:thinking_sphinx_use_group_by_shortcut] = nil
|
138
|
+
end
|
139
|
+
|
140
|
+
it "should return true if no ONLY_FULL_GROUP_BY" do
|
141
|
+
@connection.stub!(
|
142
|
+
:select_all => {:a => "OTHER SETTINGS"}
|
143
|
+
)
|
144
|
+
|
145
|
+
ThinkingSphinx.use_group_by_shortcut?.should be_true
|
146
|
+
end
|
147
|
+
|
148
|
+
it "should return true if NULL value" do
|
149
|
+
@connection.stub!(
|
150
|
+
:select_all => {:a => nil}
|
151
|
+
)
|
152
|
+
|
153
|
+
ThinkingSphinx.use_group_by_shortcut?.should be_true
|
154
|
+
end
|
155
|
+
|
156
|
+
it "should return false if ONLY_FULL_GROUP_BY is set" do
|
157
|
+
@connection.stub!(
|
158
|
+
:select_all => {:a => "OTHER SETTINGS,ONLY_FULL_GROUP_BY,blah"}
|
159
|
+
)
|
160
|
+
|
161
|
+
ThinkingSphinx.use_group_by_shortcut?.should be_false
|
162
|
+
end
|
163
|
+
|
164
|
+
it "should return false if ONLY_FULL_GROUP_BY is set in any of the values" do
|
165
|
+
@connection.stub!(
|
166
|
+
:select_all => {
|
167
|
+
:a => "OTHER SETTINGS",
|
168
|
+
:b => "ONLY_FULL_GROUP_BY"
|
169
|
+
}
|
170
|
+
)
|
171
|
+
|
172
|
+
ThinkingSphinx.use_group_by_shortcut?.should be_false
|
173
|
+
end
|
174
|
+
|
175
|
+
describe "if not using MySQL" do
|
176
|
+
before :each do
|
177
|
+
adapter = defined?(JRUBY_VERSION) ? 'JdbcAdapter' : 'PostgreSQLAdapter'
|
178
|
+
unless ::ActiveRecord::ConnectionAdapters.const_defined?(adapter)
|
179
|
+
pending "No PostgreSQL"
|
180
|
+
return
|
181
|
+
end
|
182
|
+
|
183
|
+
@connection = stub(adapter).as_null_object
|
184
|
+
@connection.stub!(
|
185
|
+
:select_all => true,
|
186
|
+
:config => {:adapter => defined?(JRUBY_VERSION) ? 'jdbcpostgresql' : 'postgresql'}
|
187
|
+
)
|
188
|
+
::ActiveRecord::Base.stub!(
|
189
|
+
:connection => @connection
|
190
|
+
)
|
191
|
+
end
|
192
|
+
|
193
|
+
it "should return false" do
|
194
|
+
ThinkingSphinx.use_group_by_shortcut?.should be_false
|
195
|
+
end
|
196
|
+
|
197
|
+
it "should not call select_all" do
|
198
|
+
@connection.should_not_receive(:select_all)
|
199
|
+
|
200
|
+
ThinkingSphinx.use_group_by_shortcut?
|
201
|
+
end
|
202
|
+
end
|
203
|
+
end
|
204
|
+
end
|
data/tasks/distribution.rb
CHANGED
@@ -2,9 +2,7 @@ require 'yard'
|
|
2
2
|
require 'jeweler'
|
3
3
|
|
4
4
|
desc 'Generate documentation'
|
5
|
-
YARD::Rake::YardocTask.new
|
6
|
-
# t.title = 'Thinking Sphinx - ActiveRecord Sphinx Plugin'
|
7
|
-
end
|
5
|
+
YARD::Rake::YardocTask.new
|
8
6
|
|
9
7
|
Jeweler::Tasks.new do |gem|
|
10
8
|
gem.name = "warp-thinking-sphinx"
|
@@ -22,8 +20,7 @@ Jeweler::Tasks.new do |gem|
|
|
22
20
|
"README.textile",
|
23
21
|
"tasks/**/*.rb",
|
24
22
|
"tasks/**/*.rake",
|
25
|
-
"
|
26
|
-
"VERSION.yml"
|
23
|
+
"VERSION"
|
27
24
|
]
|
28
25
|
gem.test_files = FileList[
|
29
26
|
"features/**/*",
|
@@ -31,23 +28,12 @@ Jeweler::Tasks.new do |gem|
|
|
31
28
|
]
|
32
29
|
|
33
30
|
gem.add_dependency 'activerecord', '>= 1.15.6'
|
31
|
+
gem.add_dependency 'riddle', '>= 1.0.8'
|
32
|
+
gem.add_dependency 'after_commit', '>= 1.0.5'
|
34
33
|
|
35
34
|
gem.post_install_message = <<-MESSAGE
|
36
|
-
|
37
|
-
|
38
|
-
default is nil, to avoid any unexpected behavior. If you wish to keep the old
|
39
|
-
value though, you will need to add the following settings to your
|
40
|
-
config/sphinx.yml file:
|
41
|
-
|
42
|
-
development:
|
43
|
-
morphology: stem_en
|
44
|
-
test:
|
45
|
-
morphology: stem_en
|
46
|
-
production:
|
47
|
-
morphology: stem_en
|
48
|
-
|
49
|
-
To understand morphologies/stemmers better, visit the following link:
|
50
|
-
http://www.sphinxsearch.com/docs/manual-0.9.8.html#conf-morphology
|
35
|
+
If you're upgrading, you should read this:
|
36
|
+
http://freelancing-god.github.com/ts/en/upgrading.html
|
51
37
|
|
52
38
|
MESSAGE
|
53
39
|
end
|
data/tasks/testing.rb
CHANGED
@@ -10,17 +10,17 @@ end
|
|
10
10
|
|
11
11
|
desc "Run all feature-set configurations"
|
12
12
|
task :features do |t|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
13
|
+
databases = ENV['DATABASES'] || 'mysql,postgresql'
|
14
|
+
databases.split(',').each do |database|
|
15
|
+
puts "rake features:#{database}"
|
16
|
+
system "rake features:#{database}"
|
17
|
+
end
|
17
18
|
end
|
18
19
|
|
19
20
|
namespace :features do
|
20
21
|
def add_task(name, description)
|
21
22
|
Cucumber::Rake::Task.new(name, description) do |t|
|
22
|
-
t.cucumber_opts = "--format pretty"
|
23
|
-
t.profile = name
|
23
|
+
t.cucumber_opts = "--format pretty features/*.feature DATABASE=#{name}"
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
@@ -62,22 +62,11 @@ end
|
|
62
62
|
|
63
63
|
desc "Build cucumber.yml file"
|
64
64
|
task :cucumber_defaults do
|
65
|
-
|
66
|
-
--require features/support/env.rb
|
67
|
-
--require features/support/db/mysql.rb
|
68
|
-
--require features/support/db/active_record.rb
|
69
|
-
--require features/support/post_database.rb
|
70
|
-
).join(" ")
|
71
|
-
|
72
|
-
step_definitions = FileList["features/step_definitions/**.rb"].collect { |path|
|
65
|
+
steps = FileList["features/step_definitions/**.rb"].collect { |path|
|
73
66
|
"--require #{path}"
|
74
67
|
}.join(" ")
|
75
68
|
|
76
|
-
features = FileList["features/*.feature"].join(" ")
|
77
|
-
|
78
69
|
File.open('cucumber.yml', 'w') { |f|
|
79
|
-
f.write "default: \"
|
80
|
-
f.write "mysql: \"#{default_requires} #{step_definitions} #{features}\"\n\n"
|
81
|
-
f.write "postgresql: \"#{default_requires.gsub(/mysql/, 'postgresql')} #{step_definitions} #{features}\""
|
70
|
+
f.write "default: \"--require features/support/env.rb #{steps}\"\n"
|
82
71
|
}
|
83
72
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: warp-thinking-sphinx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pat Allan
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-12-11 00:00:00 +08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -22,6 +22,26 @@ dependencies:
|
|
22
22
|
- !ruby/object:Gem::Version
|
23
23
|
version: 1.15.6
|
24
24
|
version:
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: riddle
|
27
|
+
type: :runtime
|
28
|
+
version_requirement:
|
29
|
+
version_requirements: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 1.0.8
|
34
|
+
version:
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
name: after_commit
|
37
|
+
type: :runtime
|
38
|
+
version_requirement:
|
39
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: 1.0.5
|
44
|
+
version:
|
25
45
|
description: A concise and easy-to-use Ruby library that connects ActiveRecord to the Sphinx search daemon, managing configuration, indexing and searching.
|
26
46
|
email: pat@freelancing-gods.com
|
27
47
|
executables: []
|
@@ -33,7 +53,10 @@ extra_rdoc_files:
|
|
33
53
|
files:
|
34
54
|
- LICENCE
|
35
55
|
- README.textile
|
36
|
-
- VERSION
|
56
|
+
- VERSION
|
57
|
+
- lib/cucumber/thinking_sphinx/external_world.rb
|
58
|
+
- lib/cucumber/thinking_sphinx/internal_world.rb
|
59
|
+
- lib/cucumber/thinking_sphinx/sql_logger.rb
|
37
60
|
- lib/thinking_sphinx.rb
|
38
61
|
- lib/thinking_sphinx/active_record.rb
|
39
62
|
- lib/thinking_sphinx/active_record/attribute_updates.rb
|
@@ -45,17 +68,14 @@ files:
|
|
45
68
|
- lib/thinking_sphinx/adapters/postgresql_adapter.rb
|
46
69
|
- lib/thinking_sphinx/association.rb
|
47
70
|
- lib/thinking_sphinx/attribute.rb
|
71
|
+
- lib/thinking_sphinx/auto_version.rb
|
48
72
|
- lib/thinking_sphinx/class_facet.rb
|
49
73
|
- lib/thinking_sphinx/configuration.rb
|
74
|
+
- lib/thinking_sphinx/context.rb
|
50
75
|
- lib/thinking_sphinx/core/array.rb
|
51
76
|
- lib/thinking_sphinx/core/string.rb
|
52
77
|
- lib/thinking_sphinx/deltas.rb
|
53
|
-
- lib/thinking_sphinx/deltas/datetime_delta.rb
|
54
78
|
- lib/thinking_sphinx/deltas/default_delta.rb
|
55
|
-
- lib/thinking_sphinx/deltas/delayed_delta.rb
|
56
|
-
- lib/thinking_sphinx/deltas/delayed_delta/delta_job.rb
|
57
|
-
- lib/thinking_sphinx/deltas/delayed_delta/flag_as_deleted_job.rb
|
58
|
-
- lib/thinking_sphinx/deltas/delayed_delta/job.rb
|
59
79
|
- lib/thinking_sphinx/deploy/capistrano.rb
|
60
80
|
- lib/thinking_sphinx/excerpter.rb
|
61
81
|
- lib/thinking_sphinx/facet.rb
|
@@ -72,58 +92,18 @@ files:
|
|
72
92
|
- lib/thinking_sphinx/source/internal_properties.rb
|
73
93
|
- lib/thinking_sphinx/source/sql.rb
|
74
94
|
- lib/thinking_sphinx/tasks.rb
|
95
|
+
- lib/thinking_sphinx/test.rb
|
75
96
|
- rails/init.rb
|
76
97
|
- tasks/distribution.rb
|
77
98
|
- tasks/rails.rake
|
78
99
|
- tasks/testing.rb
|
79
|
-
- vendor/after_commit/LICENSE
|
80
|
-
- vendor/after_commit/README
|
81
|
-
- vendor/after_commit/Rakefile
|
82
|
-
- vendor/after_commit/init.rb
|
83
|
-
- vendor/after_commit/lib/after_commit.rb
|
84
|
-
- vendor/after_commit/lib/after_commit/active_record.rb
|
85
|
-
- vendor/after_commit/lib/after_commit/connection_adapters.rb
|
86
|
-
- vendor/after_commit/test/after_commit_test.rb
|
87
|
-
- vendor/delayed_job/lib/delayed/job.rb
|
88
|
-
- vendor/delayed_job/lib/delayed/message_sending.rb
|
89
|
-
- vendor/delayed_job/lib/delayed/performable_method.rb
|
90
|
-
- vendor/delayed_job/lib/delayed/worker.rb
|
91
|
-
- vendor/riddle/lib/riddle.rb
|
92
|
-
- vendor/riddle/lib/riddle/client.rb
|
93
|
-
- vendor/riddle/lib/riddle/client/filter.rb
|
94
|
-
- vendor/riddle/lib/riddle/client/message.rb
|
95
|
-
- vendor/riddle/lib/riddle/client/response.rb
|
96
|
-
- vendor/riddle/lib/riddle/configuration.rb
|
97
|
-
- vendor/riddle/lib/riddle/configuration/distributed_index.rb
|
98
|
-
- vendor/riddle/lib/riddle/configuration/index.rb
|
99
|
-
- vendor/riddle/lib/riddle/configuration/indexer.rb
|
100
|
-
- vendor/riddle/lib/riddle/configuration/remote_index.rb
|
101
|
-
- vendor/riddle/lib/riddle/configuration/searchd.rb
|
102
|
-
- vendor/riddle/lib/riddle/configuration/section.rb
|
103
|
-
- vendor/riddle/lib/riddle/configuration/source.rb
|
104
|
-
- vendor/riddle/lib/riddle/configuration/sql_source.rb
|
105
|
-
- vendor/riddle/lib/riddle/configuration/xml_source.rb
|
106
|
-
- vendor/riddle/lib/riddle/controller.rb
|
107
100
|
has_rdoc: true
|
108
101
|
homepage: http://ts.freelancing-gods.com
|
109
102
|
licenses: []
|
110
103
|
|
111
104
|
post_install_message: |+
|
112
|
-
|
113
|
-
|
114
|
-
default is nil, to avoid any unexpected behavior. If you wish to keep the old
|
115
|
-
value though, you will need to add the following settings to your
|
116
|
-
config/sphinx.yml file:
|
117
|
-
|
118
|
-
development:
|
119
|
-
morphology: stem_en
|
120
|
-
test:
|
121
|
-
morphology: stem_en
|
122
|
-
production:
|
123
|
-
morphology: stem_en
|
124
|
-
|
125
|
-
To understand morphologies/stemmers better, visit the following link:
|
126
|
-
http://www.sphinxsearch.com/docs/manual-0.9.8.html#conf-morphology
|
105
|
+
If you're upgrading, you should read this:
|
106
|
+
http://freelancing-god.github.com/ts/en/upgrading.html
|
127
107
|
|
128
108
|
rdoc_options:
|
129
109
|
- --charset=UTF-8
|
@@ -149,119 +129,114 @@ signing_key:
|
|
149
129
|
specification_version: 3
|
150
130
|
summary: ActiveRecord/Rails Sphinx library
|
151
131
|
test_files:
|
152
|
-
- features/a.rb
|
153
132
|
- features/attribute_transformation.feature
|
154
|
-
- features/attribute_updates.feature
|
155
|
-
- features/datetime_deltas.feature
|
156
|
-
- features/delayed_delta_indexing.feature
|
157
|
-
- features/deleting_instances.feature
|
158
|
-
- features/extensible_delta_indexing.feature
|
159
|
-
- features/facets.feature
|
160
|
-
- features/facets_across_model.feature
|
161
|
-
- features/handling_edits.feature
|
162
133
|
- features/retry_stale_indexes.feature
|
163
|
-
- features/
|
164
|
-
- features/searching_by_model.feature
|
165
|
-
- features/searching_with_find_arguments.feature
|
134
|
+
- features/sphinx_scopes.feature
|
166
135
|
- features/sphinx_detection.feature
|
167
|
-
- features/step_definitions/alpha_steps.rb
|
168
136
|
- features/step_definitions/beta_steps.rb
|
169
|
-
- features/step_definitions/
|
170
|
-
- features/step_definitions/datetime_delta_steps.rb
|
171
|
-
- features/step_definitions/delayed_delta_indexing_steps.rb
|
137
|
+
- features/step_definitions/gamma_steps.rb
|
172
138
|
- features/step_definitions/extensible_delta_indexing_steps.rb
|
173
139
|
- features/step_definitions/facet_steps.rb
|
174
|
-
- features/step_definitions/
|
175
|
-
- features/step_definitions/gamma_steps.rb
|
176
|
-
- features/step_definitions/search_steps.rb
|
140
|
+
- features/step_definitions/alpha_steps.rb
|
177
141
|
- features/step_definitions/sphinx_steps.rb
|
142
|
+
- features/step_definitions/search_steps.rb
|
143
|
+
- features/step_definitions/common_steps.rb
|
144
|
+
- features/step_definitions/find_arguments_steps.rb
|
178
145
|
- features/step_definitions/scope_steps.rb
|
179
|
-
- features/
|
180
|
-
- features/
|
181
|
-
- features/
|
182
|
-
- features/
|
183
|
-
- features/
|
184
|
-
- features/support/
|
185
|
-
- features/support/db/fixtures/
|
186
|
-
- features/support/db/fixtures/cats.rb
|
187
|
-
- features/support/db/fixtures/comments.rb
|
188
|
-
- features/support/db/fixtures/delayed_betas.rb
|
146
|
+
- features/facets.feature
|
147
|
+
- features/searching_by_index.feature
|
148
|
+
- features/facets_across_model.feature
|
149
|
+
- features/abstract_inheritance.feature
|
150
|
+
- features/handling_edits.feature
|
151
|
+
- features/support/database.example.yml
|
152
|
+
- features/support/db/fixtures/music.rb
|
189
153
|
- features/support/db/fixtures/developers.rb
|
154
|
+
- features/support/db/fixtures/robots.rb
|
155
|
+
- features/support/db/fixtures/tags.rb
|
156
|
+
- features/support/db/fixtures/comments.rb
|
157
|
+
- features/support/db/fixtures/foxes.rb
|
190
158
|
- features/support/db/fixtures/dogs.rb
|
191
|
-
- features/support/db/fixtures/
|
192
|
-
- features/support/db/fixtures/gammas.rb
|
193
|
-
- features/support/db/fixtures/people.rb
|
159
|
+
- features/support/db/fixtures/betas.rb
|
194
160
|
- features/support/db/fixtures/posts.rb
|
195
|
-
- features/support/db/fixtures/
|
196
|
-
- features/support/db/fixtures/
|
161
|
+
- features/support/db/fixtures/alphas.rb
|
162
|
+
- features/support/db/fixtures/categories.rb
|
197
163
|
- features/support/db/fixtures/authors.rb
|
198
|
-
- features/support/db/fixtures/
|
199
|
-
- features/support/db/
|
200
|
-
- features/support/db/
|
201
|
-
- features/support/db/
|
202
|
-
- features/support/db/
|
164
|
+
- features/support/db/fixtures/gammas.rb
|
165
|
+
- features/support/db/fixtures/extensible_betas.rb
|
166
|
+
- features/support/db/fixtures/people.rb
|
167
|
+
- features/support/db/fixtures/boxes.rb
|
168
|
+
- features/support/db/fixtures/cats.rb
|
203
169
|
- features/support/db/migrations/create_categories.rb
|
204
|
-
- features/support/db/migrations/
|
205
|
-
- features/support/db/migrations/
|
170
|
+
- features/support/db/migrations/create_robots.rb
|
171
|
+
- features/support/db/migrations/create_music.rb
|
172
|
+
- features/support/db/migrations/create_betas.rb
|
173
|
+
- features/support/db/migrations/create_authors_posts.rb
|
174
|
+
- features/support/db/migrations/create_posts.rb
|
175
|
+
- features/support/db/migrations/create_alphas.rb
|
206
176
|
- features/support/db/migrations/create_developers.rb
|
207
|
-
- features/support/db/migrations/
|
177
|
+
- features/support/db/migrations/create_authors.rb
|
178
|
+
- features/support/db/migrations/create_tags.rb
|
208
179
|
- features/support/db/migrations/create_gammas.rb
|
209
180
|
- features/support/db/migrations/create_people.rb
|
210
|
-
- features/support/db/migrations/
|
181
|
+
- features/support/db/migrations/create_extensible_betas.rb
|
182
|
+
- features/support/db/migrations/create_animals.rb
|
183
|
+
- features/support/db/migrations/create_comments.rb
|
184
|
+
- features/support/db/migrations/create_genres.rb
|
211
185
|
- features/support/db/migrations/create_taggings.rb
|
212
|
-
- features/support/db/migrations/
|
213
|
-
- features/support/db/migrations/create_thetas.rb
|
214
|
-
- features/support/db/migrations/create_authors.rb
|
215
|
-
- features/support/db/migrations/create_authors_posts.rb
|
216
|
-
- features/support/db/migrations/create_robots.rb
|
217
|
-
- features/support/db/mysql.rb
|
218
|
-
- features/support/db/postgresql.rb
|
219
|
-
- features/support/env.rb
|
186
|
+
- features/support/db/migrations/create_boxes.rb
|
220
187
|
- features/support/lib/generic_delta_handler.rb
|
221
|
-
- features/support/
|
222
|
-
- features/support/models/
|
188
|
+
- features/support/env.rb
|
189
|
+
- features/support/models/music.rb
|
223
190
|
- features/support/models/beta.rb
|
224
|
-
- features/support/models/
|
225
|
-
- features/support/models/cat.rb
|
226
|
-
- features/support/models/category.rb
|
227
|
-
- features/support/models/comment.rb
|
228
|
-
- features/support/models/delayed_beta.rb
|
191
|
+
- features/support/models/gamma.rb
|
229
192
|
- features/support/models/developer.rb
|
193
|
+
- features/support/models/fox.rb
|
194
|
+
- features/support/models/tag.rb
|
195
|
+
- features/support/models/robot.rb
|
196
|
+
- features/support/models/cat.rb
|
197
|
+
- features/support/models/medium.rb
|
198
|
+
- features/support/models/person.rb
|
199
|
+
- features/support/models/alpha.rb
|
200
|
+
- features/support/models/box.rb
|
201
|
+
- features/support/models/author.rb
|
230
202
|
- features/support/models/dog.rb
|
203
|
+
- features/support/models/animal.rb
|
204
|
+
- features/support/models/category.rb
|
231
205
|
- features/support/models/extensible_beta.rb
|
232
|
-
- features/support/models/
|
233
|
-
- features/support/models/
|
234
|
-
- features/support/models/post.rb
|
235
|
-
- features/support/models/tag.rb
|
206
|
+
- features/support/models/genre.rb
|
207
|
+
- features/support/models/comment.rb
|
236
208
|
- features/support/models/tagging.rb
|
237
|
-
- features/support/models/
|
238
|
-
- features/
|
239
|
-
- features/
|
240
|
-
- features/
|
241
|
-
- features/
|
209
|
+
- features/support/models/post.rb
|
210
|
+
- features/excerpts.feature
|
211
|
+
- features/extensible_delta_indexing.feature
|
212
|
+
- features/searching_by_model.feature
|
213
|
+
- features/attribute_updates.feature
|
214
|
+
- features/searching_with_find_arguments.feature
|
242
215
|
- features/alternate_primary_key.feature
|
216
|
+
- features/searching_across_models.feature
|
217
|
+
- features/sti_searching.feature
|
218
|
+
- features/deleting_instances.feature
|
243
219
|
- features/direct_attributes.feature
|
244
|
-
-
|
245
|
-
-
|
246
|
-
- spec/
|
247
|
-
- spec/
|
248
|
-
- spec/
|
249
|
-
- spec/
|
250
|
-
- spec/
|
251
|
-
- spec/
|
252
|
-
- spec/
|
253
|
-
- spec/
|
254
|
-
- spec/
|
255
|
-
- spec/
|
256
|
-
- spec/
|
257
|
-
- spec/
|
258
|
-
- spec/
|
259
|
-
- spec/
|
260
|
-
- spec/
|
261
|
-
- spec/
|
262
|
-
- spec/
|
263
|
-
- spec/
|
264
|
-
- spec/
|
265
|
-
- spec/
|
266
|
-
- spec/
|
267
|
-
- spec/lib/thinking_sphinx_spec.rb
|
220
|
+
- spec/thinking_sphinx/core/string_spec.rb
|
221
|
+
- spec/thinking_sphinx/core/array_spec.rb
|
222
|
+
- spec/thinking_sphinx/auto_version_spec.rb
|
223
|
+
- spec/thinking_sphinx/field_spec.rb
|
224
|
+
- spec/thinking_sphinx/context_spec.rb
|
225
|
+
- spec/thinking_sphinx/active_record/has_many_association_spec.rb
|
226
|
+
- spec/thinking_sphinx/active_record/scopes_spec.rb
|
227
|
+
- spec/thinking_sphinx/active_record/delta_spec.rb
|
228
|
+
- spec/thinking_sphinx/active_record_spec.rb
|
229
|
+
- spec/thinking_sphinx/search_methods_spec.rb
|
230
|
+
- spec/thinking_sphinx/index_spec.rb
|
231
|
+
- spec/thinking_sphinx/source_spec.rb
|
232
|
+
- spec/thinking_sphinx/search_spec.rb
|
233
|
+
- spec/thinking_sphinx/configuration_spec.rb
|
234
|
+
- spec/thinking_sphinx/facet_spec.rb
|
235
|
+
- spec/thinking_sphinx/facet_search_spec.rb
|
236
|
+
- spec/thinking_sphinx/attribute_spec.rb
|
237
|
+
- spec/thinking_sphinx/association_spec.rb
|
238
|
+
- spec/thinking_sphinx/index/builder_spec.rb
|
239
|
+
- spec/thinking_sphinx/index/faux_column_spec.rb
|
240
|
+
- spec/thinking_sphinx/excerpter_spec.rb
|
241
|
+
- spec/thinking_sphinx/rails_additions_spec.rb
|
242
|
+
- spec/thinking_sphinx_spec.rb
|