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.
- data/README.textile +22 -0
- data/VERSION.yml +4 -0
- data/lib/thinking_sphinx/active_record/scopes.rb +39 -0
- data/lib/thinking_sphinx/active_record.rb +27 -7
- data/lib/thinking_sphinx/adapters/postgresql_adapter.rb +9 -3
- data/lib/thinking_sphinx/association.rb +4 -1
- data/lib/thinking_sphinx/attribute.rb +91 -30
- data/lib/thinking_sphinx/configuration.rb +51 -12
- data/lib/thinking_sphinx/deltas/datetime_delta.rb +2 -2
- data/lib/thinking_sphinx/deltas/default_delta.rb +1 -1
- data/lib/thinking_sphinx/deltas/delayed_delta/delta_job.rb +1 -1
- data/lib/thinking_sphinx/deltas/delayed_delta.rb +3 -0
- data/lib/thinking_sphinx/deploy/capistrano.rb +25 -8
- data/lib/thinking_sphinx/excerpter.rb +22 -0
- data/lib/thinking_sphinx/facet.rb +1 -1
- data/lib/thinking_sphinx/facet_search.rb +134 -0
- data/lib/thinking_sphinx/index.rb +2 -1
- data/lib/thinking_sphinx/rails_additions.rb +14 -0
- data/lib/thinking_sphinx/search.rb +599 -658
- data/lib/thinking_sphinx/search_methods.rb +421 -0
- data/lib/thinking_sphinx/source/internal_properties.rb +1 -1
- data/lib/thinking_sphinx/source/sql.rb +17 -13
- data/lib/thinking_sphinx/source.rb +6 -6
- data/lib/thinking_sphinx/tasks.rb +42 -8
- data/lib/thinking_sphinx.rb +82 -54
- data/rails/init.rb +14 -0
- data/spec/{unit → lib}/thinking_sphinx/active_record/delta_spec.rb +5 -5
- data/spec/{unit → lib}/thinking_sphinx/active_record/has_many_association_spec.rb +0 -0
- data/spec/lib/thinking_sphinx/active_record/scopes_spec.rb +96 -0
- data/spec/{unit → lib}/thinking_sphinx/active_record_spec.rb +51 -31
- data/spec/{unit → lib}/thinking_sphinx/association_spec.rb +4 -5
- data/spec/lib/thinking_sphinx/attribute_spec.rb +465 -0
- data/spec/{unit → lib}/thinking_sphinx/configuration_spec.rb +161 -29
- data/spec/{unit → lib}/thinking_sphinx/core/string_spec.rb +0 -0
- data/spec/lib/thinking_sphinx/excerpter_spec.rb +49 -0
- data/spec/lib/thinking_sphinx/facet_search_spec.rb +176 -0
- data/spec/{unit → lib}/thinking_sphinx/facet_spec.rb +24 -0
- data/spec/{unit → lib}/thinking_sphinx/field_spec.rb +8 -8
- data/spec/{unit → lib}/thinking_sphinx/index/builder_spec.rb +6 -2
- data/spec/{unit → lib}/thinking_sphinx/index/faux_column_spec.rb +0 -0
- data/spec/lib/thinking_sphinx/index_spec.rb +45 -0
- data/spec/{unit → lib}/thinking_sphinx/rails_additions_spec.rb +25 -5
- data/spec/lib/thinking_sphinx/search_methods_spec.rb +152 -0
- data/spec/lib/thinking_sphinx/search_spec.rb +960 -0
- data/spec/{unit → lib}/thinking_sphinx/source_spec.rb +63 -2
- data/spec/{unit → lib}/thinking_sphinx_spec.rb +32 -4
- data/tasks/distribution.rb +36 -35
- data/vendor/riddle/lib/riddle/client/message.rb +4 -3
- data/vendor/riddle/lib/riddle/client.rb +3 -0
- data/vendor/riddle/lib/riddle/configuration/section.rb +8 -2
- data/vendor/riddle/lib/riddle/controller.rb +17 -7
- data/vendor/riddle/lib/riddle.rb +1 -1
- metadata +79 -83
- data/lib/thinking_sphinx/active_record/search.rb +0 -57
- data/lib/thinking_sphinx/collection.rb +0 -148
- data/lib/thinking_sphinx/facet_collection.rb +0 -59
- data/lib/thinking_sphinx/search/facets.rb +0 -98
- data/spec/unit/thinking_sphinx/active_record/search_spec.rb +0 -107
- data/spec/unit/thinking_sphinx/attribute_spec.rb +0 -232
- data/spec/unit/thinking_sphinx/collection_spec.rb +0 -14
- data/spec/unit/thinking_sphinx/facet_collection_spec.rb +0 -64
- data/spec/unit/thinking_sphinx/index_spec.rb +0 -139
- 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.
|
152
|
-
|
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) ?
|
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
|
-
|
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
|
-
|
155
|
+
@connection.should_not_receive(:select_all)
|
128
156
|
|
129
|
-
|
157
|
+
ThinkingSphinx.use_group_by_shortcut?
|
130
158
|
end
|
131
159
|
end
|
132
160
|
end
|
data/tasks/distribution.rb
CHANGED
@@ -1,48 +1,49 @@
|
|
1
|
-
require '
|
2
|
-
require '
|
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::
|
9
|
-
|
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
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
s.
|
24
|
-
|
25
|
-
|
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
|
-
|
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
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
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
|
-
|
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
|
-
|
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
|
@@ -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
|
-
|
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
|
-
|
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
|
-
|
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?(
|
34
|
-
|
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 &&
|
48
|
+
!!pid && !!Process.kill(0, pid.to_i)
|
49
|
+
rescue
|
50
|
+
false
|
42
51
|
end
|
52
|
+
|
43
53
|
end
|
44
54
|
end
|
data/vendor/riddle/lib/riddle.rb
CHANGED
@@ -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 =
|
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.
|
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-
|
12
|
+
date: 2009-08-02 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
|
-
dependencies:
|
15
|
-
|
16
|
-
|
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/
|
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/
|
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
|
-
-
|
62
|
-
- LICENCE
|
63
|
-
- README.textile
|
74
|
+
- rails/init.rb
|
64
75
|
- tasks/distribution.rb
|
65
|
-
- tasks/testing.rb
|
66
76
|
- tasks/rails.rake
|
67
|
-
-
|
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/
|
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
|
-
|
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
|
-
- --
|
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:
|
150
|
-
rubygems_version: 1.
|
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/
|
156
|
-
- spec/
|
157
|
-
- spec/
|
158
|
-
- spec/
|
159
|
-
- spec/
|
160
|
-
- spec/
|
161
|
-
- spec/
|
162
|
-
- spec/
|
163
|
-
- spec/
|
164
|
-
- spec/
|
165
|
-
- spec/
|
166
|
-
- spec/
|
167
|
-
- spec/
|
168
|
-
- spec/
|
169
|
-
- spec/
|
170
|
-
- spec/
|
171
|
-
- spec/
|
172
|
-
- spec/
|
173
|
-
- spec/
|
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
|