thinking-sphinx 1.3.13 → 1.3.14

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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.3.13
1
+ 1.3.14
@@ -32,6 +32,7 @@ Feature: Update attributes directly to Sphinx
32
32
  Then I should get 1 result
33
33
 
34
34
  When I change the value of beta eight to 18
35
+ And I wait for Sphinx to catch up
35
36
  And I filter by 18 on value
36
37
  Then I should get 1 result
37
38
 
@@ -5,7 +5,7 @@ Feature: Search and browse across models by their defined facets
5
5
  When I am requesting facet results
6
6
  And I want all possible attributes
7
7
  Then I should have valid facet results
8
- And I should have 11 facets
8
+ And I should have 12 facets
9
9
  And I should have the facet Class
10
10
  And the Class facet should have a "Person" key
11
11
  And I should have the facet Gender
@@ -19,7 +19,7 @@ Feature: Search and browse across models by their defined facets
19
19
  When I am requesting facet results
20
20
  And I want all possible attributes
21
21
  And I don't want classes included
22
- Then I should have 10 facets
22
+ Then I should have 11 facets
23
23
  And I should not have the facet Class
24
24
 
25
25
  Scenario: Requesting facets common to all indexed models
@@ -14,7 +14,7 @@ Feature: Keeping Sphinx in line with model changes when requested
14
14
  And I search for two
15
15
  Then I should get 1 result
16
16
 
17
- Scenario: Not returing an instance from old data if there is a delta
17
+ Scenario: Not returning an instance from old data if there is a delta
18
18
  Given Sphinx is running
19
19
  And I am searching on betas
20
20
  When I search for two
@@ -1,6 +1,6 @@
1
1
  class Beta < ActiveRecord::Base
2
2
  define_index do
3
- indexes :name, :sortable => true
3
+ indexes :name, :sortable => true, :facet => true
4
4
  has value
5
5
 
6
6
  set_property :delta => true
@@ -352,6 +352,8 @@ block:
352
352
  value.to_i
353
353
  when Date
354
354
  value.to_time.to_i
355
+ when String
356
+ value.to_crc32
355
357
  else
356
358
  value
357
359
  end
@@ -93,8 +93,6 @@ module ThinkingSphinx
93
93
  end
94
94
 
95
95
  @configuration = Riddle::Configuration.new
96
- @configuration.searchd.address = "127.0.0.1"
97
- @configuration.searchd.port = 9312
98
96
  @configuration.searchd.pid_file = "#{self.app_root}/log/searchd.#{environment}.pid"
99
97
  @configuration.searchd.log = "#{self.app_root}/log/searchd.log"
100
98
  @configuration.searchd.query_log = "#{self.app_root}/log/searchd.query.log"
@@ -102,6 +100,8 @@ module ThinkingSphinx
102
100
  @controller = Riddle::Controller.new @configuration,
103
101
  "#{self.app_root}/config/#{environment}.sphinx.conf"
104
102
 
103
+ self.address = "127.0.0.1"
104
+ self.port = 9312
105
105
  self.database_yml_file = "#{self.app_root}/config/database.yml"
106
106
  self.searchd_file_path = "#{self.app_root}/db/sphinx/#{environment}"
107
107
  self.allow_star = false
@@ -150,18 +150,20 @@ module ThinkingSphinx
150
150
  end
151
151
 
152
152
  def address
153
- @configuration.searchd.address
153
+ @address
154
154
  end
155
155
 
156
156
  def address=(address)
157
+ @address = address
157
158
  @configuration.searchd.address = address
158
159
  end
159
160
 
160
161
  def port
161
- @configuration.searchd.port
162
+ @port
162
163
  end
163
164
 
164
165
  def port=(port)
166
+ @port = port
165
167
  @configuration.searchd.port = port
166
168
  end
167
169
 
@@ -7,7 +7,7 @@ class ThinkingSphinx::Context
7
7
 
8
8
  def prepare
9
9
  load_models
10
- add_indexed_models if cached?
10
+ add_indexed_models
11
11
  end
12
12
 
13
13
  def define_indexes
@@ -33,12 +33,6 @@ class ThinkingSphinx::Context
33
33
 
34
34
  private
35
35
 
36
- def cached?
37
- defined?(Rails) &&
38
- Rails::VERSION::STRING.to_f > 2.1 &&
39
- Rails.configuration.cache_classes
40
- end
41
-
42
36
  def add_indexed_models
43
37
  Object.subclasses_of(ActiveRecord::Base).each do |klass|
44
38
  add_indexed_model klass if klass.has_sphinx_indexes?
@@ -558,5 +558,13 @@ describe ThinkingSphinx::Attribute do
558
558
  @instance.stub!(:assoc_name => stub('object', :id => 42))
559
559
  @attribute.live_value(@instance).should == 42
560
560
  end
561
+
562
+ it "should translate crc strings to their integer values" do
563
+ @attribute = ThinkingSphinx::Attribute.new @source, [
564
+ stub('column', :__stack => [], :__name => "col_name")
565
+ ], :crc => true, :type => :string
566
+ @instance.stub!(:col_name => 'foo')
567
+ @attribute.live_value(@instance).should == 'foo'.to_crc32
568
+ end
561
569
  end
562
- end
570
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thinking-sphinx
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.13
4
+ version: 1.3.14
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-15 00:00:00 +11:00
12
+ date: 2009-12-22 00:00:00 +11:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency