ultrasphinx 1.8 → 1.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. data.tar.gz.sig +1 -3
  2. data/CHANGELOG +4 -0
  3. data/DEPLOYMENT_NOTES +7 -3
  4. data/Manifest +10 -0
  5. data/RAKE_TASKS +4 -2
  6. data/README +35 -18
  7. data/TODO +0 -1
  8. data/examples/default.base +24 -19
  9. data/lib/ultrasphinx.rb +1 -1
  10. data/lib/ultrasphinx/configure.rb +66 -25
  11. data/lib/ultrasphinx/core_extensions.rb +10 -1
  12. data/lib/ultrasphinx/is_indexed.rb +49 -6
  13. data/lib/ultrasphinx/search.rb +81 -69
  14. data/lib/ultrasphinx/search/internals.rb +61 -38
  15. data/lib/ultrasphinx/search/parser.rb +17 -7
  16. data/lib/ultrasphinx/ultrasphinx.rb +69 -16
  17. data/tasks/ultrasphinx.rake +47 -29
  18. data/test/config/ultrasphinx/test.base +50 -21
  19. data/test/integration/app/app/models/geo/address.rb +2 -1
  20. data/test/integration/app/app/models/person/user.rb +12 -3
  21. data/test/integration/app/app/models/seller.rb +2 -1
  22. data/test/integration/app/config/environment.rb +2 -0
  23. data/test/integration/app/config/ultrasphinx/default.base +16 -8
  24. data/test/integration/app/config/ultrasphinx/development.conf +319 -0
  25. data/test/integration/app/config/ultrasphinx/development.conf.canonical +152 -24
  26. data/test/integration/app/db/schema.rb +56 -0
  27. data/test/integration/app/test/fixtures/sellers.yml +1 -1
  28. data/test/integration/app/test/fixtures/users.yml +1 -1
  29. data/test/integration/app/test/unit/country_test.rb +8 -0
  30. data/test/integration/delta_test.rb +39 -0
  31. data/test/integration/search_test.rb +60 -1
  32. data/test/integration/spell_test.rb +6 -2
  33. data/test/profile/benchmark.rb +44 -0
  34. data/test/test_helper.rb +6 -1
  35. data/test/unit/parser_test.rb +21 -2
  36. data/ultrasphinx.gemspec +4 -4
  37. data/vendor/riddle/README +2 -2
  38. data/vendor/riddle/lib/riddle.rb +1 -1
  39. data/vendor/riddle/lib/riddle/client.rb +45 -10
  40. data/vendor/riddle/spec/fixtures/data/anchor.bin +0 -0
  41. data/vendor/riddle/spec/fixtures/data/any.bin +0 -0
  42. data/vendor/riddle/spec/fixtures/data/boolean.bin +0 -0
  43. data/vendor/riddle/spec/fixtures/data/distinct.bin +0 -0
  44. data/vendor/riddle/spec/fixtures/data/field_weights.bin +0 -0
  45. data/vendor/riddle/spec/fixtures/data/filter.bin +0 -0
  46. data/vendor/riddle/spec/fixtures/data/group.bin +0 -0
  47. data/vendor/riddle/spec/fixtures/data/index.bin +0 -0
  48. data/vendor/riddle/spec/fixtures/data/index_weights.bin +0 -0
  49. data/vendor/riddle/spec/fixtures/data/phrase.bin +0 -0
  50. data/vendor/riddle/spec/fixtures/data/rank_mode.bin +0 -0
  51. data/vendor/riddle/spec/fixtures/data/simple.bin +0 -0
  52. data/vendor/riddle/spec/fixtures/data/sort.bin +0 -0
  53. data/vendor/riddle/spec/fixtures/data/update_simple.bin +0 -0
  54. data/vendor/riddle/spec/fixtures/data/weights.bin +0 -0
  55. data/vendor/riddle/spec/fixtures/data_generator.php +130 -0
  56. data/vendor/riddle/spec/fixtures/sphinxapi.php +1066 -0
  57. data/vendor/riddle/spec/spec_helper.rb +1 -0
  58. data/vendor/riddle/spec/unit/client_spec.rb +18 -4
  59. metadata +12 -2
  60. metadata.gz.sig +0 -0
@@ -8,6 +8,7 @@ Spec::Runner.configure do |config|
8
8
  sphinx.index
9
9
 
10
10
  config.before :all do
11
+ `php -f spec/fixtures/data_generator.php`
11
12
  sphinx.start
12
13
  end
13
14
 
@@ -15,12 +15,12 @@ describe Riddle::Client do
15
15
 
16
16
  it "should translate anchor arguments correctly" do
17
17
  client = Riddle::Client.new
18
- client.set_anchor "latitude", 10.0, "longtitude", 95.0
18
+ client.set_anchor "latitude", 10.0, "longitude", 95.0
19
19
  client.anchor.should == {
20
20
  :latitude_attribute => "latitude",
21
21
  :latitude => 10.0,
22
- :longtitude_attribute => "longtitude",
23
- :longtitude => 95.0
22
+ :longitude_attribute => "longitude",
23
+ :longitude => 95.0
24
24
  }
25
25
  end
26
26
 
@@ -104,11 +104,25 @@ describe Riddle::Client do
104
104
 
105
105
  it "should build a message with an anchor correctly" do
106
106
  client = Riddle::Client.new
107
- client.set_anchor "latitude", 10.0, "longtitude", 95.0
107
+ client.set_anchor "latitude", 10.0, "longitude", 95.0
108
108
  client.append_query "test "
109
109
  client.queue.first.should == query_contents(:anchor)
110
110
  end
111
111
 
112
+ it "should build a message with index weights correctly" do
113
+ client = Riddle::Client.new
114
+ client.index_weights = {"people" => 101}
115
+ client.append_query "test "
116
+ client.queue.first.should == query_contents(:index_weights)
117
+ end
118
+
119
+ it "should build a message with field weights correctly" do
120
+ client = Riddle::Client.new
121
+ client.field_weights = {"city" => 101}
122
+ client.append_query "test "
123
+ client.queue.first.should == query_contents(:field_weights)
124
+ end
125
+
112
126
  it "should keep multiple messages in the queue" do
113
127
  client = Riddle::Client.new
114
128
  client.weights = [100, 1]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ultrasphinx
3
3
  version: !ruby/object:Gem::Version
4
- version: "1.8"
4
+ version: "1.9"
5
5
  platform: ruby
6
6
  authors:
7
7
  - ""
@@ -30,7 +30,7 @@ cert_chain:
30
30
  yZ0=
31
31
  -----END CERTIFICATE-----
32
32
 
33
- date: 2008-02-05 00:00:00 -05:00
33
+ date: 2008-03-08 00:00:00 -05:00
34
34
  default_executable:
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
@@ -124,6 +124,7 @@ files:
124
124
  - test/integration/app/config/locomotive.yml
125
125
  - test/integration/app/config/routes.rb
126
126
  - test/integration/app/config/ultrasphinx/default.base
127
+ - test/integration/app/config/ultrasphinx/development.conf
127
128
  - test/integration/app/config/ultrasphinx/development.conf.canonical
128
129
  - test/integration/app/db/migrate/001_create_users.rb
129
130
  - test/integration/app/db/migrate/002_create_sellers.rb
@@ -134,6 +135,7 @@ files:
134
135
  - test/integration/app/db/migrate/007_add_lat_and_long_to_address.rb
135
136
  - test/integration/app/db/migrate/008_add_mission_statement_to_seller.rb
136
137
  - test/integration/app/db/migrate/009_create_countries.rb
138
+ - test/integration/app/db/schema.rb
137
139
  - test/integration/app/doc/README_FOR_APP
138
140
  - test/integration/app/public/404.html
139
141
  - test/integration/app/public/500.html
@@ -176,13 +178,16 @@ files:
176
178
  - test/integration/app/test/functional/users_controller_test.rb
177
179
  - test/integration/app/test/test_helper.rb
178
180
  - test/integration/app/test/unit/address_test.rb
181
+ - test/integration/app/test/unit/country_test.rb
179
182
  - test/integration/app/test/unit/seller_test.rb
180
183
  - test/integration/app/test/unit/state_test.rb
181
184
  - test/integration/app/test/unit/user_test.rb
182
185
  - test/integration/configure_test.rb
186
+ - test/integration/delta_test.rb
183
187
  - test/integration/search_test.rb
184
188
  - test/integration/server_test.rb
185
189
  - test/integration/spell_test.rb
190
+ - test/profile/benchmark.rb
186
191
  - test/setup.rb
187
192
  - test/teardown.rb
188
193
  - test/test_all.rb
@@ -202,6 +207,7 @@ files:
202
207
  - vendor/riddle/spec/fixtures/data/any.bin
203
208
  - vendor/riddle/spec/fixtures/data/boolean.bin
204
209
  - vendor/riddle/spec/fixtures/data/distinct.bin
210
+ - vendor/riddle/spec/fixtures/data/field_weights.bin
205
211
  - vendor/riddle/spec/fixtures/data/filter.bin
206
212
  - vendor/riddle/spec/fixtures/data/filter_array.bin
207
213
  - vendor/riddle/spec/fixtures/data/filter_array_exclude.bin
@@ -212,12 +218,16 @@ files:
212
218
  - vendor/riddle/spec/fixtures/data/filter_range_exclude.bin
213
219
  - vendor/riddle/spec/fixtures/data/group.bin
214
220
  - vendor/riddle/spec/fixtures/data/index.bin
221
+ - vendor/riddle/spec/fixtures/data/index_weights.bin
215
222
  - vendor/riddle/spec/fixtures/data/phrase.bin
223
+ - vendor/riddle/spec/fixtures/data/rank_mode.bin
216
224
  - vendor/riddle/spec/fixtures/data/simple.bin
217
225
  - vendor/riddle/spec/fixtures/data/sort.bin
218
226
  - vendor/riddle/spec/fixtures/data/update_simple.bin
219
227
  - vendor/riddle/spec/fixtures/data/weights.bin
228
+ - vendor/riddle/spec/fixtures/data_generator.php
220
229
  - vendor/riddle/spec/fixtures/sphinx/configuration.erb
230
+ - vendor/riddle/spec/fixtures/sphinxapi.php
221
231
  - vendor/riddle/spec/fixtures/sql/conf.example.yml
222
232
  - vendor/riddle/spec/fixtures/sql/data.sql
223
233
  - vendor/riddle/spec/fixtures/sql/structure.sql
metadata.gz.sig CHANGED
Binary file