sayso-thinking-sphinx 2.0.3.001

Sign up to get free protection for your applications and to get access to all the features.
Files changed (164) hide show
  1. data/LICENCE +20 -0
  2. data/README.textile +251 -0
  3. data/VERSION +1 -0
  4. data/features/abstract_inheritance.feature +10 -0
  5. data/features/alternate_primary_key.feature +27 -0
  6. data/features/attribute_transformation.feature +22 -0
  7. data/features/attribute_updates.feature +77 -0
  8. data/features/deleting_instances.feature +67 -0
  9. data/features/direct_attributes.feature +11 -0
  10. data/features/excerpts.feature +21 -0
  11. data/features/extensible_delta_indexing.feature +9 -0
  12. data/features/facets.feature +88 -0
  13. data/features/facets_across_model.feature +29 -0
  14. data/features/field_sorting.feature +18 -0
  15. data/features/handling_edits.feature +94 -0
  16. data/features/retry_stale_indexes.feature +24 -0
  17. data/features/searching_across_models.feature +20 -0
  18. data/features/searching_by_index.feature +40 -0
  19. data/features/searching_by_model.feature +168 -0
  20. data/features/searching_with_find_arguments.feature +56 -0
  21. data/features/sphinx_detection.feature +25 -0
  22. data/features/sphinx_scopes.feature +68 -0
  23. data/features/step_definitions/alpha_steps.rb +16 -0
  24. data/features/step_definitions/beta_steps.rb +7 -0
  25. data/features/step_definitions/common_steps.rb +197 -0
  26. data/features/step_definitions/extensible_delta_indexing_steps.rb +7 -0
  27. data/features/step_definitions/facet_steps.rb +96 -0
  28. data/features/step_definitions/find_arguments_steps.rb +36 -0
  29. data/features/step_definitions/gamma_steps.rb +15 -0
  30. data/features/step_definitions/scope_steps.rb +19 -0
  31. data/features/step_definitions/search_steps.rb +94 -0
  32. data/features/step_definitions/sphinx_steps.rb +35 -0
  33. data/features/sti_searching.feature +19 -0
  34. data/features/support/env.rb +27 -0
  35. data/features/support/lib/generic_delta_handler.rb +8 -0
  36. data/features/thinking_sphinx/database.example.yml +3 -0
  37. data/features/thinking_sphinx/db/fixtures/alphas.rb +10 -0
  38. data/features/thinking_sphinx/db/fixtures/authors.rb +1 -0
  39. data/features/thinking_sphinx/db/fixtures/betas.rb +11 -0
  40. data/features/thinking_sphinx/db/fixtures/boxes.rb +9 -0
  41. data/features/thinking_sphinx/db/fixtures/categories.rb +1 -0
  42. data/features/thinking_sphinx/db/fixtures/cats.rb +3 -0
  43. data/features/thinking_sphinx/db/fixtures/comments.rb +24 -0
  44. data/features/thinking_sphinx/db/fixtures/developers.rb +31 -0
  45. data/features/thinking_sphinx/db/fixtures/dogs.rb +3 -0
  46. data/features/thinking_sphinx/db/fixtures/extensible_betas.rb +10 -0
  47. data/features/thinking_sphinx/db/fixtures/foxes.rb +3 -0
  48. data/features/thinking_sphinx/db/fixtures/gammas.rb +10 -0
  49. data/features/thinking_sphinx/db/fixtures/music.rb +4 -0
  50. data/features/thinking_sphinx/db/fixtures/people.rb +1001 -0
  51. data/features/thinking_sphinx/db/fixtures/posts.rb +6 -0
  52. data/features/thinking_sphinx/db/fixtures/robots.rb +14 -0
  53. data/features/thinking_sphinx/db/fixtures/tags.rb +27 -0
  54. data/features/thinking_sphinx/db/migrations/create_alphas.rb +8 -0
  55. data/features/thinking_sphinx/db/migrations/create_animals.rb +5 -0
  56. data/features/thinking_sphinx/db/migrations/create_authors.rb +3 -0
  57. data/features/thinking_sphinx/db/migrations/create_authors_posts.rb +6 -0
  58. data/features/thinking_sphinx/db/migrations/create_betas.rb +5 -0
  59. data/features/thinking_sphinx/db/migrations/create_boxes.rb +5 -0
  60. data/features/thinking_sphinx/db/migrations/create_categories.rb +3 -0
  61. data/features/thinking_sphinx/db/migrations/create_comments.rb +10 -0
  62. data/features/thinking_sphinx/db/migrations/create_developers.rb +7 -0
  63. data/features/thinking_sphinx/db/migrations/create_extensible_betas.rb +5 -0
  64. data/features/thinking_sphinx/db/migrations/create_gammas.rb +3 -0
  65. data/features/thinking_sphinx/db/migrations/create_genres.rb +3 -0
  66. data/features/thinking_sphinx/db/migrations/create_music.rb +6 -0
  67. data/features/thinking_sphinx/db/migrations/create_people.rb +13 -0
  68. data/features/thinking_sphinx/db/migrations/create_posts.rb +5 -0
  69. data/features/thinking_sphinx/db/migrations/create_robots.rb +4 -0
  70. data/features/thinking_sphinx/db/migrations/create_taggings.rb +5 -0
  71. data/features/thinking_sphinx/db/migrations/create_tags.rb +4 -0
  72. data/features/thinking_sphinx/models/alpha.rb +23 -0
  73. data/features/thinking_sphinx/models/andrew.rb +17 -0
  74. data/features/thinking_sphinx/models/animal.rb +5 -0
  75. data/features/thinking_sphinx/models/author.rb +3 -0
  76. data/features/thinking_sphinx/models/beta.rb +13 -0
  77. data/features/thinking_sphinx/models/box.rb +8 -0
  78. data/features/thinking_sphinx/models/cat.rb +3 -0
  79. data/features/thinking_sphinx/models/category.rb +4 -0
  80. data/features/thinking_sphinx/models/comment.rb +10 -0
  81. data/features/thinking_sphinx/models/developer.rb +20 -0
  82. data/features/thinking_sphinx/models/dog.rb +3 -0
  83. data/features/thinking_sphinx/models/extensible_beta.rb +9 -0
  84. data/features/thinking_sphinx/models/fox.rb +5 -0
  85. data/features/thinking_sphinx/models/gamma.rb +5 -0
  86. data/features/thinking_sphinx/models/genre.rb +3 -0
  87. data/features/thinking_sphinx/models/medium.rb +5 -0
  88. data/features/thinking_sphinx/models/music.rb +8 -0
  89. data/features/thinking_sphinx/models/person.rb +24 -0
  90. data/features/thinking_sphinx/models/post.rb +21 -0
  91. data/features/thinking_sphinx/models/robot.rb +12 -0
  92. data/features/thinking_sphinx/models/tag.rb +3 -0
  93. data/features/thinking_sphinx/models/tagging.rb +4 -0
  94. data/lib/cucumber/thinking_sphinx/external_world.rb +12 -0
  95. data/lib/cucumber/thinking_sphinx/internal_world.rb +127 -0
  96. data/lib/cucumber/thinking_sphinx/sql_logger.rb +20 -0
  97. data/lib/thinking-sphinx.rb +1 -0
  98. data/lib/thinking_sphinx.rb +301 -0
  99. data/lib/thinking_sphinx/action_controller.rb +31 -0
  100. data/lib/thinking_sphinx/active_record.rb +352 -0
  101. data/lib/thinking_sphinx/active_record/attribute_updates.rb +52 -0
  102. data/lib/thinking_sphinx/active_record/delta.rb +92 -0
  103. data/lib/thinking_sphinx/active_record/has_many_association.rb +36 -0
  104. data/lib/thinking_sphinx/active_record/has_many_association_with_scopes.rb +21 -0
  105. data/lib/thinking_sphinx/active_record/log_subscriber.rb +61 -0
  106. data/lib/thinking_sphinx/active_record/scopes.rb +93 -0
  107. data/lib/thinking_sphinx/adapters/abstract_adapter.rb +87 -0
  108. data/lib/thinking_sphinx/adapters/mysql_adapter.rb +58 -0
  109. data/lib/thinking_sphinx/adapters/postgresql_adapter.rb +153 -0
  110. data/lib/thinking_sphinx/association.rb +169 -0
  111. data/lib/thinking_sphinx/attribute.rb +389 -0
  112. data/lib/thinking_sphinx/auto_version.rb +38 -0
  113. data/lib/thinking_sphinx/bundled_search.rb +44 -0
  114. data/lib/thinking_sphinx/class_facet.rb +16 -0
  115. data/lib/thinking_sphinx/configuration.rb +355 -0
  116. data/lib/thinking_sphinx/context.rb +76 -0
  117. data/lib/thinking_sphinx/core/string.rb +15 -0
  118. data/lib/thinking_sphinx/deltas.rb +28 -0
  119. data/lib/thinking_sphinx/deltas/default_delta.rb +62 -0
  120. data/lib/thinking_sphinx/deploy/capistrano.rb +101 -0
  121. data/lib/thinking_sphinx/excerpter.rb +23 -0
  122. data/lib/thinking_sphinx/facet.rb +127 -0
  123. data/lib/thinking_sphinx/facet_search.rb +166 -0
  124. data/lib/thinking_sphinx/field.rb +82 -0
  125. data/lib/thinking_sphinx/index.rb +157 -0
  126. data/lib/thinking_sphinx/index/builder.rb +312 -0
  127. data/lib/thinking_sphinx/index/faux_column.rb +118 -0
  128. data/lib/thinking_sphinx/join.rb +37 -0
  129. data/lib/thinking_sphinx/property.rb +185 -0
  130. data/lib/thinking_sphinx/railtie.rb +46 -0
  131. data/lib/thinking_sphinx/search.rb +950 -0
  132. data/lib/thinking_sphinx/search_methods.rb +439 -0
  133. data/lib/thinking_sphinx/source.rb +163 -0
  134. data/lib/thinking_sphinx/source/internal_properties.rb +46 -0
  135. data/lib/thinking_sphinx/source/sql.rb +148 -0
  136. data/lib/thinking_sphinx/tasks.rb +139 -0
  137. data/lib/thinking_sphinx/test.rb +55 -0
  138. data/spec/thinking_sphinx/active_record/delta_spec.rb +128 -0
  139. data/spec/thinking_sphinx/active_record/has_many_association_spec.rb +72 -0
  140. data/spec/thinking_sphinx/active_record/scopes_spec.rb +176 -0
  141. data/spec/thinking_sphinx/active_record_spec.rb +576 -0
  142. data/spec/thinking_sphinx/adapters/abstract_adapter_spec.rb +145 -0
  143. data/spec/thinking_sphinx/association_spec.rb +216 -0
  144. data/spec/thinking_sphinx/attribute_spec.rb +560 -0
  145. data/spec/thinking_sphinx/auto_version_spec.rb +63 -0
  146. data/spec/thinking_sphinx/configuration_spec.rb +288 -0
  147. data/spec/thinking_sphinx/context_spec.rb +128 -0
  148. data/spec/thinking_sphinx/core/array_spec.rb +9 -0
  149. data/spec/thinking_sphinx/core/string_spec.rb +9 -0
  150. data/spec/thinking_sphinx/excerpter_spec.rb +49 -0
  151. data/spec/thinking_sphinx/facet_search_spec.rb +170 -0
  152. data/spec/thinking_sphinx/facet_spec.rb +359 -0
  153. data/spec/thinking_sphinx/field_spec.rb +127 -0
  154. data/spec/thinking_sphinx/index/builder_spec.rb +508 -0
  155. data/spec/thinking_sphinx/index/faux_column_spec.rb +36 -0
  156. data/spec/thinking_sphinx/index_spec.rb +183 -0
  157. data/spec/thinking_sphinx/search_methods_spec.rb +156 -0
  158. data/spec/thinking_sphinx/search_spec.rb +1387 -0
  159. data/spec/thinking_sphinx/source_spec.rb +253 -0
  160. data/spec/thinking_sphinx/test_spec.rb +20 -0
  161. data/spec/thinking_sphinx_spec.rb +203 -0
  162. data/tasks/distribution.rb +33 -0
  163. data/tasks/testing.rb +80 -0
  164. metadata +509 -0
data/LICENCE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2008 Pat Allan
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.textile ADDED
@@ -0,0 +1,251 @@
1
+ h1. Slightly modified version of Thinking Sphinx
2
+
3
+ h2. Performance improvements
4
+
5
+ This version uses MySQL ORDER BY FIELD(id,..) instruction to sort results returned by sphinx without using Ruby. It also means, that it will be incompatible with DBMS not supporting FIELD function.
6
+
7
+ h2. Removed automated includes
8
+
9
+ I this version, all of your models which use TS must manually include ThinkingSphinx modules. Example:
10
+
11
+ class Person
12
+
13
+ # Sphinx
14
+ include ThinkingSphinx::ActiveRecord::Scopes
15
+ include ThinkingSphinx::SearchMethods
16
+ include ThinkingSphinx::ActiveRecord::AttributeUpdates
17
+ include ThinkingSphinx::ActiveRecord::Delta
18
+ define_index do
19
+ ...
20
+ end
21
+
22
+ ...
23
+ end
24
+
25
+ Because of that, it is a lot easier to override default sphinx methods.
26
+
27
+ h2. Default behaviour in tests
28
+
29
+ One of the reason to create this fork is to ensure that Thinking Sphinx will behave in same way on both production and test enviroment.
30
+
31
+ h2. Extended overrides in sphinx.yml
32
+
33
+ In sphinx.yml you can use:
34
+
35
+ development:
36
+ place_delta_0:
37
+ sql_query_pre: [ 'SET NAMES utf8' ]
38
+
39
+ to add an option which is specific only to single section of sphinx configuration file.
40
+
41
+
42
+ h1. Thinking Sphinx
43
+
44
+ Please note: this is the branch for Rails 3. At some point in the near future, it will be released as Thinking Sphinx 2.0. It does not work with versions of Rails before v3 - I'm not sure if that'll happen in the future, but was just too much hassle right now.
45
+
46
+ If you want to give this a spin, clone the repo, check out the rails3 branch, and run @rake build@ to generate the gem.
47
+
48
+ h2. Usage
49
+
50
+ First, if you haven't done so already, check out the main "usage":http://ts.freelancing-gods.com/usage.html page. Once you've done that, the next place to look for information is the specific method docs - ThinkingSphinx::Search and ThinkingSphinx::Index::Builder in particular.
51
+
52
+ Keep in mind that while Thinking Sphinx works for ActiveRecord with Merb, it doesn't yet support DataMapper (although that is planned).
53
+
54
+ h2. Contributing
55
+
56
+ Fork on GitHub and after you've committed tested patches, send a pull request.
57
+
58
+ To quickly see if your system is ready to run the thinking sphinx specs, run the contribute.rb script found in the project root directory. Use the following instructions to install any missing requirements.
59
+
60
+ To get the spec suite running, you will need to install the ginger gem:
61
+
62
+ <pre><code>sudo gem install ginger --source http://gemcutter.org</code></pre>
63
+
64
+ Then install the cucumber, yard, jeweler and rspec gems. Make sure you have a git install version 1.6.0.0 or higher, otherwise the jeweler gem won't install. Bluecloth is required for some of the yard documentation.
65
+
66
+ <pre>
67
+ sudo gem install bluecloth cucumber yard jeweler rspec
68
+ </pre>
69
+
70
+ Then set up your database:
71
+
72
+ <pre>
73
+ cp spec/fixtures/database.yml.default spec/fixtures/database.yml &&
74
+ mysqladmin -u root create thinking_sphinx
75
+ </pre>
76
+
77
+ This last step can be done automatically by the contribute.rb script if all dependencies are met.
78
+
79
+ Make sure you don't have another Sphinx daemon (searchd) running. If you do, quit it with "rake ts:stop"
80
+ in the app root.
81
+
82
+ You should now have a passing test suite from which to build your patch on.
83
+
84
+ <pre>
85
+ rake spec
86
+ </pre>
87
+
88
+ If you get the message "Failed to start searchd daemon", run the spec with sudo:
89
+
90
+ <pre>
91
+ sudo rake spec
92
+ </pre>
93
+
94
+ If you quit the spec suite before it's completed, you may be left with data in the test
95
+ database, causing the next run to have failures. Let that run complete and then try again.
96
+
97
+ h2. Contributors
98
+
99
+ Since I first released this library, there's been quite a few people who have submitted patches, to my immense gratitude. Others have suggested syntax changes and general improvements. So my thanks to the following people:
100
+
101
+ * Joost Hietbrink
102
+ * Jonathan Conway
103
+ * Gregory Mirzayantz
104
+ * Tung Nguyen
105
+ * Sean Cribbs
106
+ * Benoit Caccinolo
107
+ * John Barton
108
+ * Oliver Beddows
109
+ * Arthur Zapparoli
110
+ * Dusty Doris
111
+ * Marcus Crafter
112
+ * Patrick Lenz
113
+ * Björn Andreasson
114
+ * James Healy
115
+ * Jae-Jun Hwang
116
+ * Xavier Shay
117
+ * Jason Rust
118
+ * Gopal Patel
119
+ * Chris Heald
120
+ * Peter Vandenberk
121
+ * Josh French
122
+ * Andrew Bennett
123
+ * Jordan Fowler
124
+ * Seth Walker
125
+ * Joe Noon
126
+ * Wolfgang Postler
127
+ * Rick Olson
128
+ * Killian Murphy
129
+ * Morten Primdahl
130
+ * Ryan Bates
131
+ * David Eisinger
132
+ * Shay Arnett
133
+ * Minh Tran
134
+ * Jeremy Durham
135
+ * Piotr Sarnacki
136
+ * Matt Johnson
137
+ * Nicolas Blanco
138
+ * Max Lapshin
139
+ * Josh Natanson
140
+ * Philip Hallstrom
141
+ * Christian Rishøj
142
+ * Mike Flester
143
+ * Jim Remsik
144
+ * Kennon Ballou
145
+ * Henrik Nyh
146
+ * Emil Tin
147
+ * Doug Cole
148
+ * Ed Hickey
149
+ * Evan Weaver
150
+ * Thibaut Barrere
151
+ * Kristopher Chambers
152
+ * Dmitrij Smalko
153
+ * Aleksey Yeschenko
154
+ * Lachie Cox
155
+ * Lourens Naude
156
+ * Tom Davies
157
+ * Dan Pickett
158
+ * Alex Caudill
159
+ * Jim Benton
160
+ * John Aughey
161
+ * Keith Pitty
162
+ * Jeff Talbot
163
+ * Dana Contreras
164
+ * Menno van der Sman
165
+ * Bill Harding
166
+ * Isaac Feliu
167
+ * Andrei Bocan
168
+ * László Bácsi
169
+ * Peter Wagenet
170
+ * Max Lapshin
171
+ * Martin Emde
172
+ * David Wennergren
173
+ * Mark Lane
174
+ * Eric Lindvall
175
+ * Lawrence Pit
176
+ * Mike Bailey
177
+ * Bill Leeper
178
+ * Michael Reinsch
179
+ * Anderson Dias
180
+ * Jerome Riga
181
+ * Tien Dung
182
+ * Johannes Kaefer
183
+ * Paul Campbell
184
+ * Matthew Beale
185
+ * Tom Simnett
186
+ * Erik Ostrom
187
+ * Ole Riesenberg
188
+ * Josh Kalderimis
189
+ * J.D. Hollis
190
+ * Jeffrey Chupp
191
+ * Rob Anderton
192
+ * Zach Inglis
193
+ * Ward Bekker
194
+ * Brian Terlson
195
+ * Christian Aust
196
+ * Martin Sarasale
197
+ * Édouard Brière
198
+ * Steve Madsen
199
+ * Justin DeWind
200
+ * Chris Z
201
+ * Chris Roos
202
+ * Andrew Assarattanakul
203
+ * Jonas von Andrian
204
+ * Dimitri Krassovski
205
+ * Sergey Kojin
206
+ * Brad Sumersford
207
+ * Amir Yalon
208
+ * Edgars Beigarts
209
+ * Ivan Ukhov
210
+ * Tomáš Pospíšek
211
+ * Jeffrey Hardy
212
+ * David Heinemeier Hansson
213
+ * Jimmy Hsu
214
+ * Bruno Michel
215
+ * Joren De Groof
216
+ * Jan De Poorter
217
+ * Tom Stuart
218
+ * James Brooks
219
+ * Andrew Coldham
220
+ * Mark Dodwell
221
+ * Frédéric Malamitsas
222
+ * Jon Gubman
223
+ * Michael Schuerig
224
+ * Ben Hutton
225
+ * Alfonso Jiménez
226
+ * Szymon Nowak
227
+ * Matthew Higgins
228
+ * Anton Sozontov
229
+ * Keith Pitt
230
+ * Lee Capps
231
+ * Sam Goldstein
232
+ * Artem Orlov
233
+ * Matt Todd
234
+ * Ivan Ukhov
235
+ * Stephen Celis
236
+ * Paco Guzmán
237
+ * Marcin Stecki
238
+ * Robert Glaser
239
+ * Brenton Fletcher
240
+ * Paul Schyska
241
+ * Kirill Maximov
242
+ * Hans Hasselberg
243
+ * Robert Stern
244
+ * George Anderson
245
+ * Greg Weber
246
+ * Javier Ramírez
247
+ * Patrick Tulskie
248
+ * Konstantin Shabanov
249
+ * Clemens Kofler
250
+ * Ryan Mohr
251
+ * Alex Chee
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 2.0.3.001
@@ -0,0 +1,10 @@
1
+ Feature: Abstract inheritance
2
+ In order to use Thinking Sphinx in complex situations
3
+ As a developer
4
+ I want to define indexes on subclasses of abstract models
5
+
6
+ Scenario: Searching on subclasses of abstract models
7
+ Given Sphinx is running
8
+ And I am searching on music
9
+ When I search
10
+ Then I should get 3 results
@@ -0,0 +1,27 @@
1
+ Feature: Searching on a single model
2
+ In order to use search models with non-integer primary keys
3
+ A developer
4
+ Should be able to search on a single model
5
+
6
+ Scenario: Searching using a basic query
7
+ Given Sphinx is running
8
+ And I am searching on robots
9
+ When I search for Sizzle
10
+ Then I should get 2 results
11
+
12
+ Scenario: Searching using another basic query
13
+ Given Sphinx is running
14
+ And I am searching on robots
15
+ When I search for fritz
16
+ Then I should get 1 result
17
+
18
+ Scenario: Deleting an instance
19
+ Given Sphinx is running
20
+ And I am searching on robots
21
+ When I search for Expendable
22
+ Then I should get 1 result
23
+
24
+ When I destroy robot Expendable
25
+ And I wait for Sphinx to catch up
26
+ And I search for Expendable
27
+ Then I should get 0 results
@@ -0,0 +1,22 @@
1
+ Feature: Handle not-quite-supported column types as attributes
2
+ In order for Thinking Sphinx to be more understanding with model structures
3
+ The plugin
4
+ Should be able to use translatable columns as attributes
5
+
6
+ Scenario: Decimals as floats
7
+ Given Sphinx is running
8
+ And I am searching on alphas
9
+ When I filter between 1.0 and 3.0 on cost
10
+ Then I should get 2 results
11
+
12
+ Scenario: Dates as Datetimes
13
+ Given Sphinx is running
14
+ And I am searching on alphas
15
+ When I filter between 1 and 3 days ago on created_on
16
+ Then I should get 2 results
17
+
18
+ Scenario: Timestamps as Datetimes
19
+ Given Sphinx is running
20
+ And I am searching on alphas
21
+ When I filter between 1 and 3 days ago on created_at
22
+ Then I should get 2 results
@@ -0,0 +1,77 @@
1
+ Feature: Update attributes directly to Sphinx
2
+ In order for updates to be more seamless
3
+ The plugin
4
+ Should update Sphinx's attributes where possible
5
+
6
+ Scenario: Updating attributes in Sphinx without delta indexes
7
+ Given Sphinx is running
8
+ And I am searching on alphas
9
+ When I filter by 3 on value
10
+ Then I should get 1 result
11
+
12
+ When I change the value of alpha four to 13
13
+ And I wait for Sphinx to catch up
14
+ And I filter by 13 on value
15
+ And I use index alpha_core
16
+ Then I should get 1 result
17
+ When I use index alternative_core
18
+ Then I should get 1 result
19
+
20
+ When I change the value of alpha four to 4
21
+ And I wait for Sphinx to catch up
22
+ And I filter by 13 on value
23
+ And I use index alpha_core
24
+ Then I should get 0 results
25
+ When I use index alternative_core
26
+ Then I should get 0 result
27
+
28
+ Scenario: Updating attributes in Sphinx with delta indexes
29
+ Given Sphinx is running
30
+ And I am searching on betas
31
+ When I filter by 8 on value
32
+ Then I should get 1 result
33
+
34
+ When I change the value of beta eight to 18
35
+ And I wait for Sphinx to catch up
36
+ And I filter by 18 on value
37
+ Then I should get 1 result
38
+
39
+ When I search for the document id of beta eight in the secondary_beta_delta index
40
+ Then it should not exist
41
+
42
+ Scenario: Updating attributes in a delta index
43
+ Given Sphinx is running
44
+ And I am searching on betas
45
+
46
+ When I change the name of beta nine to nineteen
47
+ And I change the value of beta nineteen to 19
48
+ And I wait for Sphinx to catch up
49
+
50
+ When I filter by 19 on value
51
+ And I use index secondary_beta_delta
52
+ Then I should get 1 result
53
+
54
+ Scenario: Updating attributes in a delta index with deltas disabled
55
+ Given Sphinx is running
56
+ And I am searching on betas
57
+
58
+ When I change the name of beta eleven to twentyone
59
+ And I disable delta updates
60
+ And I change the value of beta twentyone to 21
61
+ And I wait for Sphinx to catch up
62
+
63
+ When I filter by 21 on value
64
+ And I use index secondary_beta_delta
65
+ Then I should get 1 result
66
+ And I enable delta updates
67
+
68
+ Scenario: Updating boolean attribute in Sphinx
69
+ Given Sphinx is running
70
+ And I am searching on alphas
71
+ When I filter by active alphas
72
+ Then I should get 10 results
73
+
74
+ When I flag alpha five as inactive
75
+ And I wait for Sphinx to catch up
76
+ And I filter by active alphas
77
+ Then I should get 9 results
@@ -0,0 +1,67 @@
1
+ Feature: Keeping Sphinx in line with deleted model instances
2
+ In order to avoid deleted items being returned by Sphinx
3
+ Thinking Sphinx
4
+ Should keep deleted items out of search results
5
+
6
+ Scenario: Deleting instances from the core index
7
+ Given Sphinx is running
8
+ And I am searching on betas
9
+ When I search for three
10
+ Then I should get 1 result
11
+
12
+ When I destroy beta three
13
+ And I wait for Sphinx to catch up
14
+ And I search for three
15
+ Then I should get 0 results
16
+
17
+ Scenario: Deleting subclasses when the parent class is indexed
18
+ Given Sphinx is running
19
+ And I am searching on cats
20
+ When I search for moggy
21
+ Then I should get 1 result
22
+
23
+ When I destroy cat moggy
24
+ And I wait for Sphinx to catch up
25
+ And I search for moggy
26
+ Then I should get 0 results
27
+
28
+ Scenario: Deleting created instances from the delta index
29
+ Given Sphinx is running
30
+ And I am searching on betas
31
+ When I create a new beta named eleven
32
+ And I wait for Sphinx to catch up
33
+ And I search for eleven
34
+ Then I should get 1 result
35
+
36
+ When I destroy beta eleven
37
+ And I wait for Sphinx to catch up
38
+ And I search for eleven
39
+ Then I should get 0 results
40
+
41
+ Scenario: Deleting edited instances from the delta index
42
+ Given Sphinx is running
43
+ And I am searching on betas
44
+ When I change the name of beta four to fourteen
45
+ And I wait for Sphinx to catch up
46
+ And I search for fourteen
47
+ Then I should get 1 result
48
+
49
+ When I destroy beta fourteen
50
+ And I wait for Sphinx to catch up
51
+ And I search for fourteen
52
+ Then I should get 0 results
53
+
54
+ Scenario: Deleting created instances from the delta index when deltas are disabled
55
+ Given Sphinx is running
56
+ And I am searching on betas
57
+ When I create a new beta named thirteen
58
+ And I wait for Sphinx to catch up
59
+ And I search for thirteen
60
+ Then I should get 1 result
61
+
62
+ And I disable delta updates
63
+ And I destroy beta thirteen
64
+ And I wait for Sphinx to catch up
65
+ And I enable delta updates
66
+ And I search for thirteen
67
+ Then I should get 0 results