thinking-sphinx 1.3.13 → 1.3.14
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/features/attribute_updates.feature +1 -0
- data/features/facets_across_model.feature +2 -2
- data/features/handling_edits.feature +1 -1
- data/features/support/models/beta.rb +1 -1
- data/lib/thinking_sphinx/attribute.rb +2 -0
- data/lib/thinking_sphinx/configuration.rb +6 -4
- data/lib/thinking_sphinx/context.rb +1 -7
- data/spec/thinking_sphinx/attribute_spec.rb +9 -1
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.3.
|
1
|
+
1.3.14
|
@@ -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
|
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
|
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
|
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
|
@@ -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
|
-
@
|
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
|
-
@
|
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
|
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.
|
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-
|
12
|
+
date: 2009-12-22 00:00:00 +11:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|