DrMark-thinking-sphinx 1.1.15 → 1.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. data/README.textile +22 -0
  2. data/VERSION.yml +4 -0
  3. data/lib/thinking_sphinx/active_record/scopes.rb +39 -0
  4. data/lib/thinking_sphinx/active_record.rb +27 -7
  5. data/lib/thinking_sphinx/adapters/postgresql_adapter.rb +9 -3
  6. data/lib/thinking_sphinx/association.rb +4 -1
  7. data/lib/thinking_sphinx/attribute.rb +91 -30
  8. data/lib/thinking_sphinx/configuration.rb +51 -12
  9. data/lib/thinking_sphinx/deltas/datetime_delta.rb +2 -2
  10. data/lib/thinking_sphinx/deltas/default_delta.rb +1 -1
  11. data/lib/thinking_sphinx/deltas/delayed_delta/delta_job.rb +1 -1
  12. data/lib/thinking_sphinx/deltas/delayed_delta.rb +3 -0
  13. data/lib/thinking_sphinx/deploy/capistrano.rb +25 -8
  14. data/lib/thinking_sphinx/excerpter.rb +22 -0
  15. data/lib/thinking_sphinx/facet.rb +1 -1
  16. data/lib/thinking_sphinx/facet_search.rb +134 -0
  17. data/lib/thinking_sphinx/index.rb +2 -1
  18. data/lib/thinking_sphinx/rails_additions.rb +14 -0
  19. data/lib/thinking_sphinx/search.rb +599 -658
  20. data/lib/thinking_sphinx/search_methods.rb +421 -0
  21. data/lib/thinking_sphinx/source/internal_properties.rb +1 -1
  22. data/lib/thinking_sphinx/source/sql.rb +17 -13
  23. data/lib/thinking_sphinx/source.rb +6 -6
  24. data/lib/thinking_sphinx/tasks.rb +42 -8
  25. data/lib/thinking_sphinx.rb +82 -54
  26. data/rails/init.rb +14 -0
  27. data/spec/{unit → lib}/thinking_sphinx/active_record/delta_spec.rb +5 -5
  28. data/spec/{unit → lib}/thinking_sphinx/active_record/has_many_association_spec.rb +0 -0
  29. data/spec/lib/thinking_sphinx/active_record/scopes_spec.rb +96 -0
  30. data/spec/{unit → lib}/thinking_sphinx/active_record_spec.rb +51 -31
  31. data/spec/{unit → lib}/thinking_sphinx/association_spec.rb +4 -5
  32. data/spec/lib/thinking_sphinx/attribute_spec.rb +465 -0
  33. data/spec/{unit → lib}/thinking_sphinx/configuration_spec.rb +161 -29
  34. data/spec/{unit → lib}/thinking_sphinx/core/string_spec.rb +0 -0
  35. data/spec/lib/thinking_sphinx/excerpter_spec.rb +49 -0
  36. data/spec/lib/thinking_sphinx/facet_search_spec.rb +176 -0
  37. data/spec/{unit → lib}/thinking_sphinx/facet_spec.rb +24 -0
  38. data/spec/{unit → lib}/thinking_sphinx/field_spec.rb +8 -8
  39. data/spec/{unit → lib}/thinking_sphinx/index/builder_spec.rb +6 -2
  40. data/spec/{unit → lib}/thinking_sphinx/index/faux_column_spec.rb +0 -0
  41. data/spec/lib/thinking_sphinx/index_spec.rb +45 -0
  42. data/spec/{unit → lib}/thinking_sphinx/rails_additions_spec.rb +25 -5
  43. data/spec/lib/thinking_sphinx/search_methods_spec.rb +152 -0
  44. data/spec/lib/thinking_sphinx/search_spec.rb +960 -0
  45. data/spec/{unit → lib}/thinking_sphinx/source_spec.rb +63 -2
  46. data/spec/{unit → lib}/thinking_sphinx_spec.rb +32 -4
  47. data/tasks/distribution.rb +36 -35
  48. data/vendor/riddle/lib/riddle/client/message.rb +4 -3
  49. data/vendor/riddle/lib/riddle/client.rb +3 -0
  50. data/vendor/riddle/lib/riddle/configuration/section.rb +8 -2
  51. data/vendor/riddle/lib/riddle/controller.rb +17 -7
  52. data/vendor/riddle/lib/riddle.rb +1 -1
  53. metadata +79 -83
  54. data/lib/thinking_sphinx/active_record/search.rb +0 -57
  55. data/lib/thinking_sphinx/collection.rb +0 -148
  56. data/lib/thinking_sphinx/facet_collection.rb +0 -59
  57. data/lib/thinking_sphinx/search/facets.rb +0 -98
  58. data/spec/unit/thinking_sphinx/active_record/search_spec.rb +0 -107
  59. data/spec/unit/thinking_sphinx/attribute_spec.rb +0 -232
  60. data/spec/unit/thinking_sphinx/collection_spec.rb +0 -14
  61. data/spec/unit/thinking_sphinx/facet_collection_spec.rb +0 -64
  62. data/spec/unit/thinking_sphinx/index_spec.rb +0 -139
  63. data/spec/unit/thinking_sphinx/search_spec.rb +0 -130
@@ -37,10 +37,16 @@ describe ThinkingSphinx::Source do
37
37
  ThinkingSphinx::Attribute.new(
38
38
  @source, ThinkingSphinx::Index::FauxColumn.new(:tags, :id), :as => :tag_ids
39
39
  )
40
+ ThinkingSphinx::Attribute.new(
41
+ @source, ThinkingSphinx::Index::FauxColumn.new(:contacts, :id),
42
+ :as => :contact_ids, :source => :query
43
+ )
40
44
 
41
45
  @source.conditions << "`birthday` <= NOW()"
42
46
  @source.groupings << "`first_name`"
43
47
 
48
+ @index.local_options[:group_concat_max_len] = 1024
49
+
44
50
  @riddle = @source.to_riddle_for_core(1, 0)
45
51
  end
46
52
 
@@ -100,10 +106,18 @@ describe ThinkingSphinx::Source do
100
106
  @query.should match(/`tags`.`id`.+ AS `tag_ids`.+FROM/)
101
107
  end
102
108
 
109
+ it "should not match the sourced MVA attribute" do
110
+ @query.should_not match(/contact_ids/)
111
+ end
112
+
103
113
  it "should include joins for required associations" do
104
114
  @query.should match(/LEFT OUTER JOIN `tags`/)
105
115
  end
106
116
 
117
+ it "should not include joins for the sourced MVA attribute" do
118
+ @query.should_not match(/LEFT OUTER JOIN `contacts`/)
119
+ end
120
+
107
121
  it "should include any defined conditions" do
108
122
  @query.should match(/WHERE.+`birthday` <= NOW()/)
109
123
  end
@@ -148,8 +162,55 @@ describe ThinkingSphinx::Source do
148
162
  end
149
163
 
150
164
  it "should default to just the UTF8 statement" do
151
- @queries.length.should == 1
152
- @queries.first.should == "SET NAMES utf8"
165
+ @queries.detect { |query|
166
+ query == "SET NAMES utf8"
167
+ }.should_not be_nil
168
+ end
169
+
170
+ it "should set the group_concat_max_len session value for MySQL if requested" do
171
+ @queries.detect { |query|
172
+ query == "SET SESSION group_concat_max_len = 1024"
173
+ }.should_not be_nil
174
+ end
175
+ end
176
+ end
177
+
178
+ describe "#to_riddle_for_core with range disabled" do
179
+ before :each do
180
+ ThinkingSphinx::Field.new(
181
+ @source, ThinkingSphinx::Index::FauxColumn.new(:first_name)
182
+ )
183
+ end
184
+
185
+ describe "set per-index" do
186
+ before :each do
187
+ @index.local_options[:disable_range] = true
188
+ @riddle = @source.to_riddle_for_core(1, 0)
189
+ end
190
+
191
+ it "should not have the range in the sql_query" do
192
+ @riddle.sql_query.should_not match(/`people`.`id` >= \$start/)
193
+ @riddle.sql_query.should_not match(/`people`.`id` <= \$end/)
194
+ end
195
+
196
+ it "should not have a sql_query_range" do
197
+ @riddle.sql_query_range.should be_nil
198
+ end
199
+ end
200
+
201
+ describe "set globally" do
202
+ before :each do
203
+ ThinkingSphinx::Configuration.instance.index_options[:disable_range] = true
204
+ @riddle = @source.to_riddle_for_core(1, 0)
205
+ end
206
+
207
+ it "should not have the range in the sql_query" do
208
+ @riddle.sql_query.should_not match(/`people`.`id` >= \$start/)
209
+ @riddle.sql_query.should_not match(/`people`.`id` <= \$end/)
210
+ end
211
+
212
+ it "should not have a sql_query_range" do
213
+ @riddle.sql_query_range.should be_nil
153
214
  end
154
215
  end
155
216
  end
@@ -51,6 +51,32 @@ describe ThinkingSphinx do
51
51
  ThinkingSphinx.updates_enabled?.should be_true
52
52
  end
53
53
 
54
+ it "should always say Sphinx is running if flagged as being on a remote machine" do
55
+ ThinkingSphinx.remote_sphinx = true
56
+ ThinkingSphinx.stub_method(:sphinx_running_by_pid? => false)
57
+
58
+ ThinkingSphinx.sphinx_running?.should be_true
59
+ end
60
+
61
+ it "should actually pay attention to Sphinx if not on a remote machine" do
62
+ ThinkingSphinx.remote_sphinx = false
63
+ ThinkingSphinx.stub_method(:sphinx_running_by_pid? => false)
64
+ ThinkingSphinx.sphinx_running?.should be_false
65
+
66
+ ThinkingSphinx.stub_method(:sphinx_running_by_pid? => true)
67
+ ThinkingSphinx.sphinx_running?.should be_true
68
+ end
69
+
70
+ describe '.version' do
71
+ it "should return the version from the stored YAML file" do
72
+ version = Jeweler::VersionHelper.new(
73
+ File.join(File.dirname(__FILE__), '../..')
74
+ ).to_s
75
+
76
+ ThinkingSphinx.version.should == version
77
+ end
78
+ end
79
+
54
80
  describe "use_group_by_shortcut? method" do
55
81
  before :each do
56
82
  adapter = defined?(JRUBY_VERSION) ? :JdbcAdapter : :MysqlAdapter
@@ -105,12 +131,14 @@ describe ThinkingSphinx do
105
131
 
106
132
  describe "if not using MySQL" do
107
133
  before :each do
108
- adapter = defined?(JRUBY_VERSION) ? :JdbcAdapter : :PostgreSQLAdapter
134
+ adapter = defined?(JRUBY_VERSION) ? 'JdbcAdapter' : 'PostgreSQLAdapter'
109
135
  unless ::ActiveRecord::ConnectionAdapters.const_defined?(adapter)
110
136
  pending "No PostgreSQL"
111
137
  return
112
138
  end
113
- @connection = ::ActiveRecord::ConnectionAdapters.const_get(adapter).stub_instance(
139
+
140
+ @connection = stub(adapter).as_null_object
141
+ @connection.stub!(
114
142
  :select_all => true,
115
143
  :config => {:adapter => defined?(JRUBY_VERSION) ? 'jdbcpostgresql' : 'postgresql'}
116
144
  )
@@ -124,9 +152,9 @@ describe ThinkingSphinx do
124
152
  end
125
153
 
126
154
  it "should not call select_all" do
127
- ThinkingSphinx.use_group_by_shortcut?
155
+ @connection.should_not_receive(:select_all)
128
156
 
129
- @connection.should_not have_received(:select_all)
157
+ ThinkingSphinx.use_group_by_shortcut?
130
158
  end
131
159
  end
132
160
  end
@@ -1,48 +1,49 @@
1
- require 'rake/rdoctask'
2
- require 'rake/gempackagetask'
3
-
4
- $LOAD_PATH.unshift File.dirname(__FILE__) + '/../lib'
5
- require 'thinking_sphinx'
1
+ require 'yard'
2
+ require 'jeweler'
6
3
 
7
4
  desc 'Generate documentation'
8
- Rake::RDocTask.new(:rdoc) do |rdoc|
9
- rdoc.rdoc_dir = 'rdoc'
10
- rdoc.title = 'Thinking Sphinx - ActiveRecord Sphinx Plugin'
11
- rdoc.options << '--line-numbers' << '--inline-source'
12
- rdoc.rdoc_files.include('README')
13
- rdoc.rdoc_files.include('lib/**/*.rb')
5
+ YARD::Rake::YardocTask.new do |t|
6
+ # t.title = 'Thinking Sphinx - ActiveRecord Sphinx Plugin'
14
7
  end
15
8
 
16
- spec = Gem::Specification.new do |s|
17
- s.name = "thinking-sphinx"
18
- s.version = ThinkingSphinx::Version::String
19
- s.summary = "A concise and easy-to-use Ruby library that connects ActiveRecord to the Sphinx search daemon, managing configuration, indexing and searching."
20
- s.description = "A concise and easy-to-use Ruby library that connects ActiveRecord to the Sphinx search daemon, managing configuration, indexing and searching."
21
- s.author = "Pat Allan"
22
- s.email = "pat@freelancing-gods.com"
23
- s.homepage = "http://ts.freelancing-gods.com"
24
- s.has_rdoc = true
25
- s.rdoc_options << "--title" << "Thinking Sphinx -- Rails/Merb Sphinx Plugin" <<
26
- "--line-numbers"
27
- s.rubyforge_project = "thinking-sphinx"
28
- s.test_files = FileList["spec/**/*_spec.rb"]
29
- s.files = FileList[
9
+ Jeweler::Tasks.new do |gem|
10
+ gem.name = "thinking-sphinx"
11
+ gem.summary = "A concise and easy-to-use Ruby library that connects ActiveRecord to the Sphinx search daemon, managing configuration, indexing and searching."
12
+ gem.author = "Pat Allan"
13
+ gem.email = "pat@freelancing-gods.com"
14
+ gem.homepage = "http://ts.freelancing-gods.com"
15
+
16
+ # s.rubyforge_project = "thinking-sphinx"
17
+ gem.files = FileList[
18
+ "rails/*.rb",
30
19
  "lib/**/*.rb",
31
20
  "LICENCE",
32
21
  "README.textile",
33
22
  "tasks/**/*.rb",
34
23
  "tasks/**/*.rake",
35
- "vendor/**/*"
24
+ "vendor/**/*",
25
+ "VERSION.yml"
36
26
  ]
37
- end
27
+ gem.test_files = FileList["spec/**/*_spec.rb"]
28
+
29
+ gem.add_dependency 'activerecord', '>= 1.15.6'
30
+
31
+ gem.post_install_message = <<-MESSAGE
32
+ With the release of Thinking Sphinx 1.1.18, there is one important change to
33
+ note: previously, the default morphology for indexing was 'stem_en'. The new
34
+ default is nil, to avoid any unexpected behavior. If you wish to keep the old
35
+ value though, you will need to add the following settings to your
36
+ config/sphinx.yml file:
38
37
 
39
- Rake::GemPackageTask.new(spec) do |p|
40
- p.gem_spec = spec
41
- p.need_tar = true
42
- p.need_zip = true
43
- end
38
+ development:
39
+ morphology: stem_en
40
+ test:
41
+ morphology: stem_en
42
+ production:
43
+ morphology: stem_en
44
+
45
+ To understand morphologies/stemmers better, visit the following link:
46
+ http://www.sphinxsearch.com/docs/manual-0.9.8.html#conf-morphology
44
47
 
45
- desc "Build gemspec file"
46
- task :build do
47
- File.open('thinking-sphinx.gemspec', 'w') { |f| f.write spec.to_ruby }
48
+ MESSAGE
48
49
  end
@@ -10,14 +10,15 @@ module Riddle
10
10
 
11
11
  # Append raw data (only use if you know what you're doing)
12
12
  def append(*args)
13
- return if args.length == 0
14
-
15
13
  args.each { |arg| @message << arg }
16
14
  end
17
15
 
18
16
  # Append a string's length, then the string itself
19
17
  def append_string(str)
20
- @message << [str.send(@size_method)].pack('N') + str
18
+ string = str.respond_to?(:force_encoding) ?
19
+ str.dup.force_encoding('ASCII-8BIT') : str
20
+
21
+ @message << [string.send(@size_method)].pack('N') + string
21
22
  end
22
23
 
23
24
  # Append an integer
@@ -437,6 +437,9 @@ module Riddle
437
437
  version = 0
438
438
  length = 0
439
439
  message = Array(messages).join("")
440
+ if message.respond_to?(:force_encoding)
441
+ message = message.force_encoding('ASCII-8BIT')
442
+ end
440
443
 
441
444
  connect do |socket|
442
445
  case command
@@ -21,7 +21,7 @@ module Riddle
21
21
  conf = " #{setting} = "
22
22
  else
23
23
  conf = setting_to_array(setting).collect { |set|
24
- " #{setting} = #{set}"
24
+ " #{setting} = #{set}"
25
25
  }
26
26
  end
27
27
  conf.length == 0 ? nil : conf
@@ -30,7 +30,13 @@ module Riddle
30
30
 
31
31
  def setting_to_array(setting)
32
32
  value = send(setting)
33
- value.is_a?(Array) ? value : [value]
33
+ case value
34
+ when Array then value
35
+ when TrueClass then [1]
36
+ when FalseClass then [0]
37
+ else
38
+ [value]
39
+ end
34
40
  end
35
41
  end
36
42
  end
@@ -4,18 +4,23 @@ module Riddle
4
4
  @configuration = configuration
5
5
  @path = path
6
6
  end
7
-
7
+
8
8
  def index
9
9
  cmd = "indexer --config #{@path} --all"
10
10
  cmd << " --rotate" if running?
11
11
  `#{cmd}`
12
12
  end
13
-
13
+
14
14
  def start
15
15
  return if running?
16
16
 
17
17
  cmd = "searchd --pidfile --config #{@path}"
18
- `#{cmd}`
18
+
19
+ if RUBY_PLATFORM =~ /mswin/
20
+ system("start /B #{cmd} 1> NUL 2>&1")
21
+ else
22
+ `#{cmd}`
23
+ end
19
24
 
20
25
  sleep(1)
21
26
 
@@ -26,19 +31,24 @@ module Riddle
26
31
 
27
32
  def stop
28
33
  return unless running?
29
- `kill #{pid}`
34
+ Process.kill('SIGTERM', pid.to_i)
35
+ rescue Errno::EINVAL
36
+ Process.kill('SIGKILL', pid.to_i)
30
37
  end
31
38
 
32
39
  def pid
33
- if File.exists?("#{@configuration.searchd.pid_file}")
34
- `cat #{@configuration.searchd.pid_file}`[/\d+/]
40
+ if File.exists?(@configuration.searchd.pid_file)
41
+ File.read(@configuration.searchd.pid_file)[/\d+/]
35
42
  else
36
43
  nil
37
44
  end
38
45
  end
39
46
 
40
47
  def running?
41
- pid && `ps #{pid} | wc -l`.to_i > 1
48
+ !!pid && !!Process.kill(0, pid.to_i)
49
+ rescue
50
+ false
42
51
  end
52
+
43
53
  end
44
54
  end
@@ -18,7 +18,7 @@ module Riddle #:nodoc:
18
18
  Rev = 1533
19
19
  # Release number to mark my own fixes, beyond feature parity with
20
20
  # Sphinx itself.
21
- Release = 4
21
+ Release = 7
22
22
 
23
23
  String = [Major, Minor, Tiny].join('.')
24
24
  GemVersion = [Major, Minor, Tiny, Rev, Release].join('.')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: DrMark-thinking-sphinx
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.15
4
+ version: 1.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pat Allan
@@ -9,89 +9,90 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-05-21 00:00:00 -07:00
12
+ date: 2009-08-02 00:00:00 -07:00
13
13
  default_executable:
14
- dependencies: []
15
-
16
- description: A concise and easy-to-use Ruby library that connects ActiveRecord to the Sphinx search daemon, managing configuration, indexing and searching.
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: activerecord
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 1.15.6
24
+ version:
25
+ description:
17
26
  email: pat@freelancing-gods.com
18
27
  executables: []
19
28
 
20
29
  extensions: []
21
30
 
22
- extra_rdoc_files: []
23
-
31
+ extra_rdoc_files:
32
+ - README.textile
24
33
  files:
34
+ - LICENCE
35
+ - README.textile
36
+ - VERSION.yml
37
+ - lib/thinking_sphinx.rb
38
+ - lib/thinking_sphinx/active_record.rb
25
39
  - lib/thinking_sphinx/active_record/attribute_updates.rb
26
40
  - lib/thinking_sphinx/active_record/delta.rb
27
41
  - lib/thinking_sphinx/active_record/has_many_association.rb
28
- - lib/thinking_sphinx/active_record/search.rb
29
- - lib/thinking_sphinx/active_record.rb
42
+ - lib/thinking_sphinx/active_record/scopes.rb
30
43
  - lib/thinking_sphinx/adapters/abstract_adapter.rb
31
44
  - lib/thinking_sphinx/adapters/mysql_adapter.rb
32
45
  - lib/thinking_sphinx/adapters/postgresql_adapter.rb
33
46
  - lib/thinking_sphinx/association.rb
34
47
  - lib/thinking_sphinx/attribute.rb
35
48
  - lib/thinking_sphinx/class_facet.rb
36
- - lib/thinking_sphinx/collection.rb
37
49
  - lib/thinking_sphinx/configuration.rb
38
50
  - lib/thinking_sphinx/core/string.rb
51
+ - lib/thinking_sphinx/deltas.rb
39
52
  - lib/thinking_sphinx/deltas/datetime_delta.rb
40
53
  - lib/thinking_sphinx/deltas/default_delta.rb
54
+ - lib/thinking_sphinx/deltas/delayed_delta.rb
41
55
  - lib/thinking_sphinx/deltas/delayed_delta/delta_job.rb
42
56
  - lib/thinking_sphinx/deltas/delayed_delta/flag_as_deleted_job.rb
43
57
  - lib/thinking_sphinx/deltas/delayed_delta/job.rb
44
- - lib/thinking_sphinx/deltas/delayed_delta.rb
45
- - lib/thinking_sphinx/deltas.rb
46
58
  - lib/thinking_sphinx/deploy/capistrano.rb
59
+ - lib/thinking_sphinx/excerpter.rb
47
60
  - lib/thinking_sphinx/facet.rb
48
- - lib/thinking_sphinx/facet_collection.rb
61
+ - lib/thinking_sphinx/facet_search.rb
49
62
  - lib/thinking_sphinx/field.rb
63
+ - lib/thinking_sphinx/index.rb
50
64
  - lib/thinking_sphinx/index/builder.rb
51
65
  - lib/thinking_sphinx/index/faux_column.rb
52
- - lib/thinking_sphinx/index.rb
53
66
  - lib/thinking_sphinx/property.rb
54
67
  - lib/thinking_sphinx/rails_additions.rb
55
- - lib/thinking_sphinx/search/facets.rb
56
68
  - lib/thinking_sphinx/search.rb
69
+ - lib/thinking_sphinx/search_methods.rb
70
+ - lib/thinking_sphinx/source.rb
57
71
  - lib/thinking_sphinx/source/internal_properties.rb
58
72
  - lib/thinking_sphinx/source/sql.rb
59
- - lib/thinking_sphinx/source.rb
60
73
  - lib/thinking_sphinx/tasks.rb
61
- - lib/thinking_sphinx.rb
62
- - LICENCE
63
- - README.textile
74
+ - rails/init.rb
64
75
  - tasks/distribution.rb
65
- - tasks/testing.rb
66
76
  - tasks/rails.rake
67
- - vendor/after_commit
77
+ - tasks/testing.rb
78
+ - vendor/after_commit/LICENSE
79
+ - vendor/after_commit/README
80
+ - vendor/after_commit/Rakefile
68
81
  - vendor/after_commit/init.rb
69
- - vendor/after_commit/lib
70
- - vendor/after_commit/lib/after_commit
82
+ - vendor/after_commit/lib/after_commit.rb
71
83
  - vendor/after_commit/lib/after_commit/active_record.rb
72
84
  - vendor/after_commit/lib/after_commit/connection_adapters.rb
73
- - vendor/after_commit/lib/after_commit.rb
74
- - vendor/after_commit/LICENSE
75
- - vendor/after_commit/Rakefile
76
- - vendor/after_commit/README
77
- - vendor/after_commit/test
78
85
  - vendor/after_commit/test/after_commit_test.rb
79
- - vendor/delayed_job
80
- - vendor/delayed_job/lib
81
- - vendor/delayed_job/lib/delayed
82
86
  - vendor/delayed_job/lib/delayed/job.rb
83
87
  - vendor/delayed_job/lib/delayed/message_sending.rb
84
88
  - vendor/delayed_job/lib/delayed/performable_method.rb
85
89
  - vendor/delayed_job/lib/delayed/worker.rb
86
- - vendor/riddle
87
- - vendor/riddle/lib
88
- - vendor/riddle/lib/riddle
89
- - vendor/riddle/lib/riddle/client
90
+ - vendor/riddle/lib/riddle.rb
91
+ - vendor/riddle/lib/riddle/client.rb
90
92
  - vendor/riddle/lib/riddle/client/filter.rb
91
93
  - vendor/riddle/lib/riddle/client/message.rb
92
94
  - vendor/riddle/lib/riddle/client/response.rb
93
- - vendor/riddle/lib/riddle/client.rb
94
- - vendor/riddle/lib/riddle/configuration
95
+ - vendor/riddle/lib/riddle/configuration.rb
95
96
  - vendor/riddle/lib/riddle/configuration/distributed_index.rb
96
97
  - vendor/riddle/lib/riddle/configuration/index.rb
97
98
  - vendor/riddle/lib/riddle/configuration/indexer.rb
@@ -101,35 +102,29 @@ files:
101
102
  - vendor/riddle/lib/riddle/configuration/source.rb
102
103
  - vendor/riddle/lib/riddle/configuration/sql_source.rb
103
104
  - vendor/riddle/lib/riddle/configuration/xml_source.rb
104
- - vendor/riddle/lib/riddle/configuration.rb
105
105
  - vendor/riddle/lib/riddle/controller.rb
106
- - vendor/riddle/lib/riddle.rb
107
- - spec/unit/thinking_sphinx/active_record/delta_spec.rb
108
- - spec/unit/thinking_sphinx/active_record/has_many_association_spec.rb
109
- - spec/unit/thinking_sphinx/active_record/search_spec.rb
110
- - spec/unit/thinking_sphinx/active_record_spec.rb
111
- - spec/unit/thinking_sphinx/association_spec.rb
112
- - spec/unit/thinking_sphinx/attribute_spec.rb
113
- - spec/unit/thinking_sphinx/collection_spec.rb
114
- - spec/unit/thinking_sphinx/configuration_spec.rb
115
- - spec/unit/thinking_sphinx/core/string_spec.rb
116
- - spec/unit/thinking_sphinx/facet_collection_spec.rb
117
- - spec/unit/thinking_sphinx/facet_spec.rb
118
- - spec/unit/thinking_sphinx/field_spec.rb
119
- - spec/unit/thinking_sphinx/index/builder_spec.rb
120
- - spec/unit/thinking_sphinx/index/faux_column_spec.rb
121
- - spec/unit/thinking_sphinx/index_spec.rb
122
- - spec/unit/thinking_sphinx/rails_additions_spec.rb
123
- - spec/unit/thinking_sphinx/search_spec.rb
124
- - spec/unit/thinking_sphinx/source_spec.rb
125
- - spec/unit/thinking_sphinx_spec.rb
126
106
  has_rdoc: true
127
107
  homepage: http://ts.freelancing-gods.com
128
- post_install_message:
108
+ licenses:
109
+ post_install_message: |+
110
+ With the release of Thinking Sphinx 1.1.18, there is one important change to
111
+ note: previously, the default morphology for indexing was 'stem_en'. The new
112
+ default is nil, to avoid any unexpected behavior. If you wish to keep the old
113
+ value though, you will need to add the following settings to your
114
+ config/sphinx.yml file:
115
+
116
+ development:
117
+ morphology: stem_en
118
+ test:
119
+ morphology: stem_en
120
+ production:
121
+ morphology: stem_en
122
+
123
+ To understand morphologies/stemmers better, visit the following link:
124
+ http://www.sphinxsearch.com/docs/manual-0.9.8.html#conf-morphology
125
+
129
126
  rdoc_options:
130
- - --title
131
- - Thinking Sphinx -- Rails/Merb Sphinx Plugin
132
- - --line-numbers
127
+ - --charset=UTF-8
133
128
  require_paths:
134
129
  - lib
135
130
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -146,28 +141,29 @@ required_rubygems_version: !ruby/object:Gem::Requirement
146
141
  version:
147
142
  requirements: []
148
143
 
149
- rubyforge_project: thinking-sphinx
150
- rubygems_version: 1.2.0
144
+ rubyforge_project:
145
+ rubygems_version: 1.3.5
151
146
  signing_key:
152
147
  specification_version: 2
153
148
  summary: A concise and easy-to-use Ruby library that connects ActiveRecord to the Sphinx search daemon, managing configuration, indexing and searching.
154
149
  test_files:
155
- - spec/unit/thinking_sphinx/active_record/delta_spec.rb
156
- - spec/unit/thinking_sphinx/active_record/has_many_association_spec.rb
157
- - spec/unit/thinking_sphinx/active_record/search_spec.rb
158
- - spec/unit/thinking_sphinx/active_record_spec.rb
159
- - spec/unit/thinking_sphinx/association_spec.rb
160
- - spec/unit/thinking_sphinx/attribute_spec.rb
161
- - spec/unit/thinking_sphinx/collection_spec.rb
162
- - spec/unit/thinking_sphinx/configuration_spec.rb
163
- - spec/unit/thinking_sphinx/core/string_spec.rb
164
- - spec/unit/thinking_sphinx/facet_collection_spec.rb
165
- - spec/unit/thinking_sphinx/facet_spec.rb
166
- - spec/unit/thinking_sphinx/field_spec.rb
167
- - spec/unit/thinking_sphinx/index/builder_spec.rb
168
- - spec/unit/thinking_sphinx/index/faux_column_spec.rb
169
- - spec/unit/thinking_sphinx/index_spec.rb
170
- - spec/unit/thinking_sphinx/rails_additions_spec.rb
171
- - spec/unit/thinking_sphinx/search_spec.rb
172
- - spec/unit/thinking_sphinx/source_spec.rb
173
- - spec/unit/thinking_sphinx_spec.rb
150
+ - spec/lib/thinking_sphinx/active_record/delta_spec.rb
151
+ - spec/lib/thinking_sphinx/active_record/has_many_association_spec.rb
152
+ - spec/lib/thinking_sphinx/active_record/scopes_spec.rb
153
+ - spec/lib/thinking_sphinx/active_record_spec.rb
154
+ - spec/lib/thinking_sphinx/association_spec.rb
155
+ - spec/lib/thinking_sphinx/attribute_spec.rb
156
+ - spec/lib/thinking_sphinx/configuration_spec.rb
157
+ - spec/lib/thinking_sphinx/core/string_spec.rb
158
+ - spec/lib/thinking_sphinx/excerpter_spec.rb
159
+ - spec/lib/thinking_sphinx/facet_search_spec.rb
160
+ - spec/lib/thinking_sphinx/facet_spec.rb
161
+ - spec/lib/thinking_sphinx/field_spec.rb
162
+ - spec/lib/thinking_sphinx/index/builder_spec.rb
163
+ - spec/lib/thinking_sphinx/index/faux_column_spec.rb
164
+ - spec/lib/thinking_sphinx/index_spec.rb
165
+ - spec/lib/thinking_sphinx/rails_additions_spec.rb
166
+ - spec/lib/thinking_sphinx/search_methods_spec.rb
167
+ - spec/lib/thinking_sphinx/search_spec.rb
168
+ - spec/lib/thinking_sphinx/source_spec.rb
169
+ - spec/lib/thinking_sphinx_spec.rb
@@ -1,57 +0,0 @@
1
- module ThinkingSphinx
2
- module ActiveRecord
3
- # This module covers the specific model searches - but the syntax is
4
- # exactly the same as the core Search class - so use that as your refence
5
- # point.
6
- #
7
- module Search
8
- def self.included(base)
9
- base.class_eval do
10
- class << self
11
- # Searches for results that match the parameters provided. Will only
12
- # return the ids for the matching objects. See
13
- # ThinkingSphinx::Search#search for syntax examples.
14
- #
15
- def search_for_ids(*args)
16
- options = args.extract_options!
17
- options[:class] = self
18
- args << options
19
- ThinkingSphinx::Search.search_for_ids(*args)
20
- end
21
-
22
- # Searches for results limited to a single model. See
23
- # ThinkingSphinx::Search#search for syntax examples.
24
- #
25
- def search(*args)
26
- options = args.extract_options!
27
- options[:class] = self
28
- args << options
29
- ThinkingSphinx::Search.search(*args)
30
- end
31
-
32
- def search_count(*args)
33
- options = args.extract_options!
34
- options[:class] = self
35
- args << options
36
- ThinkingSphinx::Search.count(*args)
37
- end
38
-
39
- def search_for_id(*args)
40
- options = args.extract_options!
41
- options[:class] = self
42
- args << options
43
- ThinkingSphinx::Search.search_for_id(*args)
44
- end
45
-
46
- def facets(*args)
47
- options = args.extract_options!
48
- options[:class] = self
49
- args << options
50
- ThinkingSphinx::Search.facets(*args)
51
- end
52
- end
53
- end
54
- end
55
- end
56
- end
57
- end