warp-thinking-sphinx 1.2.12
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENCE +20 -0
- data/README.textile +144 -0
- data/VERSION.yml +4 -0
- data/features/a.rb +17 -0
- data/features/alternate_primary_key.feature +27 -0
- data/features/attribute_transformation.feature +22 -0
- data/features/attribute_updates.feature +33 -0
- data/features/datetime_deltas.feature +66 -0
- data/features/delayed_delta_indexing.feature +37 -0
- data/features/deleting_instances.feature +64 -0
- data/features/direct_attributes.feature +11 -0
- data/features/excerpts.feature +13 -0
- data/features/extensible_delta_indexing.feature +9 -0
- data/features/facets.feature +76 -0
- data/features/facets_across_model.feature +29 -0
- data/features/handling_edits.feature +92 -0
- data/features/retry_stale_indexes.feature +24 -0
- data/features/searching_across_models.feature +20 -0
- data/features/searching_by_model.feature +175 -0
- data/features/searching_with_find_arguments.feature +56 -0
- data/features/sphinx_detection.feature +25 -0
- data/features/sphinx_scopes.feature +35 -0
- data/features/step_definitions/alpha_steps.rb +3 -0
- data/features/step_definitions/beta_steps.rb +7 -0
- data/features/step_definitions/common_steps.rb +178 -0
- data/features/step_definitions/datetime_delta_steps.rb +15 -0
- data/features/step_definitions/delayed_delta_indexing_steps.rb +7 -0
- data/features/step_definitions/extensible_delta_indexing_steps.rb +7 -0
- data/features/step_definitions/facet_steps.rb +92 -0
- data/features/step_definitions/find_arguments_steps.rb +36 -0
- data/features/step_definitions/gamma_steps.rb +15 -0
- data/features/step_definitions/scope_steps.rb +11 -0
- data/features/step_definitions/search_steps.rb +89 -0
- data/features/step_definitions/sphinx_steps.rb +31 -0
- data/features/sti_searching.feature +14 -0
- data/features/support/db/active_record.rb +40 -0
- data/features/support/db/database.example.yml +3 -0
- data/features/support/db/fixtures/alphas.rb +10 -0
- data/features/support/db/fixtures/authors.rb +1 -0
- data/features/support/db/fixtures/betas.rb +10 -0
- data/features/support/db/fixtures/boxes.rb +9 -0
- data/features/support/db/fixtures/categories.rb +1 -0
- data/features/support/db/fixtures/cats.rb +3 -0
- data/features/support/db/fixtures/comments.rb +24 -0
- data/features/support/db/fixtures/delayed_betas.rb +10 -0
- data/features/support/db/fixtures/developers.rb +29 -0
- data/features/support/db/fixtures/dogs.rb +3 -0
- data/features/support/db/fixtures/extensible_betas.rb +10 -0
- data/features/support/db/fixtures/gammas.rb +10 -0
- data/features/support/db/fixtures/people.rb +1001 -0
- data/features/support/db/fixtures/posts.rb +6 -0
- data/features/support/db/fixtures/robots.rb +14 -0
- data/features/support/db/fixtures/tags.rb +27 -0
- data/features/support/db/fixtures/thetas.rb +10 -0
- data/features/support/db/migrations/create_alphas.rb +7 -0
- data/features/support/db/migrations/create_animals.rb +5 -0
- data/features/support/db/migrations/create_authors.rb +3 -0
- data/features/support/db/migrations/create_authors_posts.rb +6 -0
- data/features/support/db/migrations/create_betas.rb +5 -0
- data/features/support/db/migrations/create_boxes.rb +5 -0
- data/features/support/db/migrations/create_categories.rb +3 -0
- data/features/support/db/migrations/create_comments.rb +10 -0
- data/features/support/db/migrations/create_delayed_betas.rb +17 -0
- data/features/support/db/migrations/create_developers.rb +9 -0
- data/features/support/db/migrations/create_extensible_betas.rb +5 -0
- data/features/support/db/migrations/create_gammas.rb +3 -0
- data/features/support/db/migrations/create_people.rb +13 -0
- data/features/support/db/migrations/create_posts.rb +5 -0
- data/features/support/db/migrations/create_robots.rb +5 -0
- data/features/support/db/migrations/create_taggings.rb +5 -0
- data/features/support/db/migrations/create_tags.rb +4 -0
- data/features/support/db/migrations/create_thetas.rb +5 -0
- data/features/support/db/mysql.rb +3 -0
- data/features/support/db/postgresql.rb +3 -0
- data/features/support/env.rb +6 -0
- data/features/support/lib/generic_delta_handler.rb +8 -0
- data/features/support/models/alpha.rb +10 -0
- data/features/support/models/animal.rb +5 -0
- data/features/support/models/author.rb +3 -0
- data/features/support/models/beta.rb +8 -0
- data/features/support/models/box.rb +8 -0
- data/features/support/models/cat.rb +3 -0
- data/features/support/models/category.rb +4 -0
- data/features/support/models/comment.rb +10 -0
- data/features/support/models/delayed_beta.rb +7 -0
- data/features/support/models/developer.rb +16 -0
- data/features/support/models/dog.rb +3 -0
- data/features/support/models/extensible_beta.rb +9 -0
- data/features/support/models/gamma.rb +5 -0
- data/features/support/models/person.rb +23 -0
- data/features/support/models/post.rb +20 -0
- data/features/support/models/robot.rb +8 -0
- data/features/support/models/tag.rb +3 -0
- data/features/support/models/tagging.rb +4 -0
- data/features/support/models/theta.rb +7 -0
- data/features/support/post_database.rb +43 -0
- data/features/support/z.rb +19 -0
- data/lib/thinking_sphinx.rb +212 -0
- data/lib/thinking_sphinx/active_record.rb +306 -0
- data/lib/thinking_sphinx/active_record/attribute_updates.rb +48 -0
- data/lib/thinking_sphinx/active_record/delta.rb +87 -0
- data/lib/thinking_sphinx/active_record/has_many_association.rb +28 -0
- data/lib/thinking_sphinx/active_record/scopes.rb +39 -0
- data/lib/thinking_sphinx/adapters/abstract_adapter.rb +42 -0
- data/lib/thinking_sphinx/adapters/mysql_adapter.rb +54 -0
- data/lib/thinking_sphinx/adapters/postgresql_adapter.rb +136 -0
- data/lib/thinking_sphinx/association.rb +243 -0
- data/lib/thinking_sphinx/attribute.rb +340 -0
- data/lib/thinking_sphinx/class_facet.rb +15 -0
- data/lib/thinking_sphinx/configuration.rb +282 -0
- data/lib/thinking_sphinx/core/array.rb +7 -0
- data/lib/thinking_sphinx/core/string.rb +15 -0
- data/lib/thinking_sphinx/deltas.rb +30 -0
- data/lib/thinking_sphinx/deltas/datetime_delta.rb +50 -0
- data/lib/thinking_sphinx/deltas/default_delta.rb +68 -0
- data/lib/thinking_sphinx/deltas/delayed_delta.rb +30 -0
- data/lib/thinking_sphinx/deltas/delayed_delta/delta_job.rb +24 -0
- data/lib/thinking_sphinx/deltas/delayed_delta/flag_as_deleted_job.rb +27 -0
- data/lib/thinking_sphinx/deltas/delayed_delta/job.rb +26 -0
- data/lib/thinking_sphinx/deploy/capistrano.rb +100 -0
- data/lib/thinking_sphinx/excerpter.rb +22 -0
- data/lib/thinking_sphinx/facet.rb +125 -0
- data/lib/thinking_sphinx/facet_search.rb +134 -0
- data/lib/thinking_sphinx/field.rb +81 -0
- data/lib/thinking_sphinx/index.rb +99 -0
- data/lib/thinking_sphinx/index/builder.rb +286 -0
- data/lib/thinking_sphinx/index/faux_column.rb +110 -0
- data/lib/thinking_sphinx/property.rb +163 -0
- data/lib/thinking_sphinx/rails_additions.rb +150 -0
- data/lib/thinking_sphinx/search.rb +708 -0
- data/lib/thinking_sphinx/search_methods.rb +421 -0
- data/lib/thinking_sphinx/source.rb +152 -0
- data/lib/thinking_sphinx/source/internal_properties.rb +46 -0
- data/lib/thinking_sphinx/source/sql.rb +127 -0
- data/lib/thinking_sphinx/tasks.rb +165 -0
- data/rails/init.rb +14 -0
- data/spec/lib/thinking_sphinx/active_record/delta_spec.rb +130 -0
- data/spec/lib/thinking_sphinx/active_record/has_many_association_spec.rb +49 -0
- data/spec/lib/thinking_sphinx/active_record/scopes_spec.rb +96 -0
- data/spec/lib/thinking_sphinx/active_record_spec.rb +353 -0
- data/spec/lib/thinking_sphinx/association_spec.rb +239 -0
- data/spec/lib/thinking_sphinx/attribute_spec.rb +507 -0
- data/spec/lib/thinking_sphinx/configuration_spec.rb +268 -0
- data/spec/lib/thinking_sphinx/core/array_spec.rb +9 -0
- data/spec/lib/thinking_sphinx/core/string_spec.rb +9 -0
- data/spec/lib/thinking_sphinx/deltas/job_spec.rb +32 -0
- data/spec/lib/thinking_sphinx/excerpter_spec.rb +57 -0
- data/spec/lib/thinking_sphinx/facet_search_spec.rb +176 -0
- data/spec/lib/thinking_sphinx/facet_spec.rb +333 -0
- data/spec/lib/thinking_sphinx/field_spec.rb +154 -0
- data/spec/lib/thinking_sphinx/index/builder_spec.rb +455 -0
- data/spec/lib/thinking_sphinx/index/faux_column_spec.rb +30 -0
- data/spec/lib/thinking_sphinx/index_spec.rb +45 -0
- data/spec/lib/thinking_sphinx/rails_additions_spec.rb +203 -0
- data/spec/lib/thinking_sphinx/search_methods_spec.rb +152 -0
- data/spec/lib/thinking_sphinx/search_spec.rb +1101 -0
- data/spec/lib/thinking_sphinx/source_spec.rb +227 -0
- data/spec/lib/thinking_sphinx_spec.rb +162 -0
- data/tasks/distribution.rb +55 -0
- data/tasks/rails.rake +1 -0
- data/tasks/testing.rb +83 -0
- data/vendor/after_commit/LICENSE +20 -0
- data/vendor/after_commit/README +16 -0
- data/vendor/after_commit/Rakefile +22 -0
- data/vendor/after_commit/init.rb +8 -0
- data/vendor/after_commit/lib/after_commit.rb +45 -0
- data/vendor/after_commit/lib/after_commit/active_record.rb +114 -0
- data/vendor/after_commit/lib/after_commit/connection_adapters.rb +103 -0
- data/vendor/after_commit/test/after_commit_test.rb +53 -0
- data/vendor/delayed_job/lib/delayed/job.rb +251 -0
- data/vendor/delayed_job/lib/delayed/message_sending.rb +7 -0
- data/vendor/delayed_job/lib/delayed/performable_method.rb +55 -0
- data/vendor/delayed_job/lib/delayed/worker.rb +54 -0
- data/vendor/riddle/lib/riddle.rb +30 -0
- data/vendor/riddle/lib/riddle/client.rb +635 -0
- data/vendor/riddle/lib/riddle/client/filter.rb +53 -0
- data/vendor/riddle/lib/riddle/client/message.rb +66 -0
- data/vendor/riddle/lib/riddle/client/response.rb +84 -0
- data/vendor/riddle/lib/riddle/configuration.rb +33 -0
- data/vendor/riddle/lib/riddle/configuration/distributed_index.rb +48 -0
- data/vendor/riddle/lib/riddle/configuration/index.rb +142 -0
- data/vendor/riddle/lib/riddle/configuration/indexer.rb +19 -0
- data/vendor/riddle/lib/riddle/configuration/remote_index.rb +17 -0
- data/vendor/riddle/lib/riddle/configuration/searchd.rb +25 -0
- data/vendor/riddle/lib/riddle/configuration/section.rb +43 -0
- data/vendor/riddle/lib/riddle/configuration/source.rb +23 -0
- data/vendor/riddle/lib/riddle/configuration/sql_source.rb +34 -0
- data/vendor/riddle/lib/riddle/configuration/xml_source.rb +28 -0
- data/vendor/riddle/lib/riddle/controller.rb +53 -0
- metadata +267 -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,144 @@
|
|
1
|
+
h1. Thinking Sphinx
|
2
|
+
|
3
|
+
h2. Usage
|
4
|
+
|
5
|
+
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.
|
6
|
+
|
7
|
+
Keep in mind that while Thinking Sphinx works for ActiveRecord with Merb, it doesn't yet support DataMapper (although that is planned).
|
8
|
+
|
9
|
+
h2. Contributing
|
10
|
+
|
11
|
+
Fork on GitHub and after you've committed tested patches, send a pull request.
|
12
|
+
|
13
|
+
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.
|
14
|
+
|
15
|
+
To get the spec suite running, you will need to install the ginger gem:
|
16
|
+
|
17
|
+
sudo gem install ginger --source http://gemcutter.org
|
18
|
+
|
19
|
+
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.
|
20
|
+
|
21
|
+
sudo gem install cucumber yard jeweler rspec
|
22
|
+
|
23
|
+
Then set up your database:
|
24
|
+
|
25
|
+
cp spec/fixtures/database.yml.default spec/fixtures/database.yml
|
26
|
+
mysqladmin -u root create thinking_sphinx
|
27
|
+
|
28
|
+
This last step can be done automatically by the contribute.rb script if all dependencies are met.
|
29
|
+
|
30
|
+
Make sure you don't have another Sphinx daemon (searchd) running. If you do, quit it with "rake ts:stop"
|
31
|
+
in the app root.
|
32
|
+
|
33
|
+
You should now have a passing test suite from which to build your patch on.
|
34
|
+
|
35
|
+
rake spec
|
36
|
+
|
37
|
+
If you get the message "Failed to start searchd daemon", run the spec with sudo:
|
38
|
+
|
39
|
+
sudo rake spec
|
40
|
+
|
41
|
+
If you quit the spec suite before it's completed, you may be left with data in the test
|
42
|
+
database, causing the next run to have failures. Let that run complete and then try again.
|
43
|
+
|
44
|
+
h2. Contributors
|
45
|
+
|
46
|
+
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:
|
47
|
+
|
48
|
+
* Joost Hietbrink
|
49
|
+
* Jonathan Conway
|
50
|
+
* Gregory Mirzayantz
|
51
|
+
* Tung Nguyen
|
52
|
+
* Sean Cribbs
|
53
|
+
* Benoit Caccinolo
|
54
|
+
* John Barton
|
55
|
+
* Oliver Beddows
|
56
|
+
* Arthur Zapparoli
|
57
|
+
* Dusty Doris
|
58
|
+
* Marcus Crafter
|
59
|
+
* Patrick Lenz
|
60
|
+
* Björn Andreasson
|
61
|
+
* James Healy
|
62
|
+
* Jae-Jun Hwang
|
63
|
+
* Xavier Shay
|
64
|
+
* Jason Rust
|
65
|
+
* Gopal Patel
|
66
|
+
* Chris Heald
|
67
|
+
* Peter Vandenberk
|
68
|
+
* Josh French
|
69
|
+
* Andrew Bennett
|
70
|
+
* Jordan Fowler
|
71
|
+
* Seth Walker
|
72
|
+
* Joe Noon
|
73
|
+
* Wolfgang Postler
|
74
|
+
* Rick Olson
|
75
|
+
* Killian Murphy
|
76
|
+
* Morten Primdahl
|
77
|
+
* Ryan Bates
|
78
|
+
* David Eisinger
|
79
|
+
* Shay Arnett
|
80
|
+
* Minh Tran
|
81
|
+
* Jeremy Durham
|
82
|
+
* Piotr Sarnacki
|
83
|
+
* Matt Johnson
|
84
|
+
* Nicolas Blanco
|
85
|
+
* Max Lapshin
|
86
|
+
* Josh Natanson
|
87
|
+
* Philip Hallstrom
|
88
|
+
* Christian Rishøj
|
89
|
+
* Mike Flester
|
90
|
+
* Jim Remsik
|
91
|
+
* Kennon Ballou
|
92
|
+
* Henrik Nyh
|
93
|
+
* Emil Tin
|
94
|
+
* Doug Cole
|
95
|
+
* Ed Hickey
|
96
|
+
* Evan Weaver
|
97
|
+
* Thibaut Barrere
|
98
|
+
* Kristopher Chambers
|
99
|
+
* Dmitrij Smalko
|
100
|
+
* Aleksey Yeschenko
|
101
|
+
* Lachie Cox
|
102
|
+
* Lourens Naude
|
103
|
+
* Tom Davies
|
104
|
+
* Dan Pickett
|
105
|
+
* Alex Caudill
|
106
|
+
* Jim Benton
|
107
|
+
* John Aughey
|
108
|
+
* Keith Pitty
|
109
|
+
* Jeff Talbot
|
110
|
+
* Dana Contreras
|
111
|
+
* Menno van der Sman
|
112
|
+
* Bill Harding
|
113
|
+
* Isaac Feliu
|
114
|
+
* Andrei Bocan
|
115
|
+
* László Bácsi
|
116
|
+
* Peter Wagenet
|
117
|
+
* Max Lapshin
|
118
|
+
* Martin Emde
|
119
|
+
* David Wennergren
|
120
|
+
* Mark Lane
|
121
|
+
* Eric Lindvall
|
122
|
+
* Lawrence Pit
|
123
|
+
* Mike Bailey
|
124
|
+
* Bill Leeper
|
125
|
+
* Michael Reinsch
|
126
|
+
* Anderson Dias
|
127
|
+
* Jerome Riga
|
128
|
+
* Tien Dung
|
129
|
+
* Johannes Kaefer
|
130
|
+
* Paul Campbell
|
131
|
+
* Matthew Beale
|
132
|
+
* Tom Simnett
|
133
|
+
* Erik Ostrom
|
134
|
+
* Ole Riesenberg
|
135
|
+
* Josh Kalderimis
|
136
|
+
* J.D. Hollis
|
137
|
+
* Jeffrey Chupp
|
138
|
+
* Rob Anderton
|
139
|
+
* Zach Inglis
|
140
|
+
* Ward Bekker
|
141
|
+
* Brian Terlson
|
142
|
+
* Christian Aust
|
143
|
+
* Martin Sarasale
|
144
|
+
* Édouard Brière
|
data/VERSION.yml
ADDED
data/features/a.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# This file exists because Cucumber likes to auto-load all ruby files
|
2
|
+
puts <<-MESSAGE
|
3
|
+
Cucumber 0.1.12 defaults to loading all ruby files within the features folder
|
4
|
+
alphabetically. This is annoying, because some files need to be loaded before
|
5
|
+
others (and others perhaps not at all, given missing dependencies). Hence this
|
6
|
+
place-holder imaginatively named 'a.rb', to force this message.
|
7
|
+
|
8
|
+
A work-around is to use cucumber profiles. You will find the default profile in
|
9
|
+
cucumber.yml should serve your needs fine, unless you add new step definitions.
|
10
|
+
When you do that, you can regenerate the YAML file by running:
|
11
|
+
rake cucumber_defaults
|
12
|
+
|
13
|
+
And then run specific features as follows is slightly more verbose, but it
|
14
|
+
works, whereas this doesn't.
|
15
|
+
cucumber -p default features/something.feature
|
16
|
+
MESSAGE
|
17
|
+
exit 0
|
@@ -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 three
|
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,33 @@
|
|
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 two to 13
|
13
|
+
And I wait for Sphinx to catch up
|
14
|
+
And I filter by 13 on value
|
15
|
+
Then I should get 1 result
|
16
|
+
|
17
|
+
When I change the value of alpha two to 3
|
18
|
+
And I wait for Sphinx to catch up
|
19
|
+
And I filter by 13 on value
|
20
|
+
Then I should get 0 results
|
21
|
+
|
22
|
+
Scenario: Updating attributes in Sphinx with delta indexes
|
23
|
+
Given Sphinx is running
|
24
|
+
And I am searching on betas
|
25
|
+
When I filter by 8 on value
|
26
|
+
Then I should get 1 result
|
27
|
+
|
28
|
+
When I change the value of beta eight to 18
|
29
|
+
And I filter by 18 on value
|
30
|
+
Then I should get 1 result
|
31
|
+
|
32
|
+
When I search for the document id of beta eight in the beta_delta index
|
33
|
+
Then it should not exist
|
@@ -0,0 +1,66 @@
|
|
1
|
+
Feature: Datetime Delta Indexing
|
2
|
+
In order to have delta indexing on frequently-updated sites
|
3
|
+
Developers
|
4
|
+
Should be able to use an existing datetime column to track changes
|
5
|
+
|
6
|
+
Scenario: Delta Index should not fire automatically
|
7
|
+
Given Sphinx is running
|
8
|
+
And I am searching on thetas
|
9
|
+
When I search for one
|
10
|
+
Then I should get 1 result
|
11
|
+
|
12
|
+
When I change the name of theta one to eleven
|
13
|
+
And I wait for Sphinx to catch up
|
14
|
+
And I search for one
|
15
|
+
Then I should get 1 result
|
16
|
+
|
17
|
+
When I search for eleven
|
18
|
+
Then I should get 0 results
|
19
|
+
|
20
|
+
Scenario: Delta Index should fire when jobs are run
|
21
|
+
Given Sphinx is running
|
22
|
+
And I am searching on thetas
|
23
|
+
When I search for two
|
24
|
+
Then I should get 1 result
|
25
|
+
|
26
|
+
When I change the name of theta two to twelve
|
27
|
+
And I wait for Sphinx to catch up
|
28
|
+
And I search for twelve
|
29
|
+
Then I should get 0 results
|
30
|
+
|
31
|
+
When I index the theta datetime delta
|
32
|
+
And I wait for Sphinx to catch up
|
33
|
+
And I search for twelve
|
34
|
+
Then I should get 1 result
|
35
|
+
|
36
|
+
When I search for two
|
37
|
+
Then I should get 0 results
|
38
|
+
|
39
|
+
Scenario: New records should be merged into the core index
|
40
|
+
Given Sphinx is running
|
41
|
+
And I am searching on thetas
|
42
|
+
When I search for thirteen
|
43
|
+
Then I should get 0 results
|
44
|
+
|
45
|
+
When I create a new theta named thirteen
|
46
|
+
And I search for thirteen
|
47
|
+
Then I should get 0 results
|
48
|
+
|
49
|
+
When I index the theta datetime delta
|
50
|
+
And I wait for Sphinx to catch up
|
51
|
+
And I search for thirteen
|
52
|
+
Then I should get 1 result
|
53
|
+
|
54
|
+
When I search for the document id of theta thirteen in the theta_core index
|
55
|
+
Then it should exist
|
56
|
+
|
57
|
+
Scenario: Deleting records
|
58
|
+
Given Sphinx is running
|
59
|
+
And I am searching on thetas
|
60
|
+
When I search for three
|
61
|
+
Then I should get 1 result
|
62
|
+
|
63
|
+
When I delete the theta named three
|
64
|
+
And I wait for Sphinx to catch up
|
65
|
+
And I search for three
|
66
|
+
Then I should get 0 results
|
@@ -0,0 +1,37 @@
|
|
1
|
+
Feature: Delayed Delta Indexing
|
2
|
+
In order to have delta indexing on frequently-updated sites
|
3
|
+
Developers
|
4
|
+
Should be able to use delayed_job to handle delta indexes to lower system load
|
5
|
+
|
6
|
+
Scenario: Delta Index should not fire automatically
|
7
|
+
Given Sphinx is running
|
8
|
+
And I am searching on delayed betas
|
9
|
+
When I search for one
|
10
|
+
Then I should get 1 result
|
11
|
+
|
12
|
+
When I change the name of delayed beta one to eleven
|
13
|
+
And I wait for Sphinx to catch up
|
14
|
+
And I search for one
|
15
|
+
Then I should get 1 result
|
16
|
+
|
17
|
+
When I search for eleven
|
18
|
+
Then I should get 0 results
|
19
|
+
|
20
|
+
Scenario: Delta Index should fire when jobs are run
|
21
|
+
Given Sphinx is running
|
22
|
+
And I am searching on delayed betas
|
23
|
+
When I search for one
|
24
|
+
Then I should get 1 result
|
25
|
+
|
26
|
+
When I change the name of delayed beta two to twelve
|
27
|
+
And I wait for Sphinx to catch up
|
28
|
+
And I search for twelve
|
29
|
+
Then I should get 0 results
|
30
|
+
|
31
|
+
When I run the delayed jobs
|
32
|
+
And I wait for Sphinx to catch up
|
33
|
+
And I search for twelve
|
34
|
+
Then I should get 1 result
|
35
|
+
|
36
|
+
When I search for two
|
37
|
+
Then I should get 0 results
|
@@ -0,0 +1,64 @@
|
|
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 disable delta updates
|
60
|
+
And I destroy beta thirteen
|
61
|
+
And I wait for Sphinx to catch up
|
62
|
+
And I enable delta updates
|
63
|
+
And I search for thirteen
|
64
|
+
Then I should get 0 results
|