thinking-sphinx 1.5.0 → 2.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.textile +15 -48
- data/VERSION +1 -0
- data/features/attribute_transformation.feature +7 -7
- data/features/attribute_updates.feature +16 -18
- data/features/deleting_instances.feature +13 -16
- data/features/excerpts.feature +0 -8
- data/features/facets.feature +19 -25
- data/features/handling_edits.feature +20 -25
- data/features/searching_across_models.feature +1 -1
- data/features/searching_by_index.feature +5 -6
- data/features/searching_by_model.feature +29 -29
- data/features/sphinx_scopes.feature +0 -26
- data/features/step_definitions/common_steps.rb +6 -18
- data/features/step_definitions/scope_steps.rb +0 -4
- data/features/step_definitions/search_steps.rb +4 -9
- data/features/support/env.rb +10 -3
- data/features/thinking_sphinx/db/fixtures/alphas.rb +10 -8
- data/features/thinking_sphinx/db/fixtures/cats.rb +1 -1
- data/features/thinking_sphinx/db/fixtures/dogs.rb +1 -1
- data/features/thinking_sphinx/db/fixtures/foxes.rb +1 -1
- data/features/thinking_sphinx/db/fixtures/people.rb +1 -1
- data/features/thinking_sphinx/db/fixtures/posts.rb +1 -5
- data/features/thinking_sphinx/db/migrations/create_posts.rb +0 -1
- data/features/thinking_sphinx/models/alpha.rb +0 -1
- data/features/thinking_sphinx/models/beta.rb +0 -5
- data/features/thinking_sphinx/models/developer.rb +1 -6
- data/features/thinking_sphinx/models/music.rb +1 -3
- data/features/thinking_sphinx/models/person.rb +1 -2
- data/features/thinking_sphinx/models/post.rb +0 -1
- data/lib/cucumber/thinking_sphinx/external_world.rb +4 -8
- data/lib/cucumber/thinking_sphinx/internal_world.rb +27 -36
- data/lib/thinking_sphinx.rb +60 -132
- data/lib/thinking_sphinx/active_record.rb +98 -124
- data/lib/thinking_sphinx/active_record/attribute_updates.rb +13 -17
- data/lib/thinking_sphinx/active_record/delta.rb +15 -21
- data/lib/thinking_sphinx/active_record/has_many_association.rb +23 -16
- data/lib/thinking_sphinx/active_record/scopes.rb +0 -18
- data/lib/thinking_sphinx/adapters/abstract_adapter.rb +15 -63
- data/lib/thinking_sphinx/adapters/mysql_adapter.rb +0 -4
- data/lib/thinking_sphinx/adapters/postgresql_adapter.rb +24 -65
- data/lib/thinking_sphinx/association.rb +11 -36
- data/lib/thinking_sphinx/attribute.rb +85 -92
- data/lib/thinking_sphinx/auto_version.rb +3 -21
- data/lib/thinking_sphinx/class_facet.rb +3 -8
- data/lib/thinking_sphinx/configuration.rb +58 -114
- data/lib/thinking_sphinx/context.rb +20 -22
- data/lib/thinking_sphinx/core/array.rb +13 -0
- data/lib/thinking_sphinx/deltas.rb +0 -2
- data/lib/thinking_sphinx/deltas/default_delta.rb +22 -18
- data/lib/thinking_sphinx/deploy/capistrano.rb +31 -30
- data/lib/thinking_sphinx/excerpter.rb +1 -2
- data/lib/thinking_sphinx/facet.rb +35 -45
- data/lib/thinking_sphinx/facet_search.rb +24 -58
- data/lib/thinking_sphinx/field.rb +0 -18
- data/lib/thinking_sphinx/index.rb +36 -38
- data/lib/thinking_sphinx/index/builder.rb +59 -74
- data/lib/thinking_sphinx/property.rb +45 -66
- data/lib/thinking_sphinx/railtie.rb +35 -0
- data/lib/thinking_sphinx/search.rb +250 -506
- data/lib/thinking_sphinx/source.rb +31 -50
- data/lib/thinking_sphinx/source/internal_properties.rb +3 -8
- data/lib/thinking_sphinx/source/sql.rb +31 -71
- data/lib/thinking_sphinx/tasks.rb +27 -48
- data/spec/thinking_sphinx/active_record/delta_spec.rb +41 -36
- data/spec/thinking_sphinx/active_record/has_many_association_spec.rb +0 -96
- data/spec/thinking_sphinx/active_record/scopes_spec.rb +29 -29
- data/spec/thinking_sphinx/active_record_spec.rb +169 -140
- data/spec/thinking_sphinx/association_spec.rb +2 -20
- data/spec/thinking_sphinx/attribute_spec.rb +97 -101
- data/spec/thinking_sphinx/auto_version_spec.rb +11 -75
- data/spec/thinking_sphinx/configuration_spec.rb +62 -63
- data/spec/thinking_sphinx/context_spec.rb +66 -66
- data/spec/thinking_sphinx/facet_search_spec.rb +99 -99
- data/spec/thinking_sphinx/facet_spec.rb +4 -30
- data/spec/thinking_sphinx/field_spec.rb +3 -17
- data/spec/thinking_sphinx/index/builder_spec.rb +132 -169
- data/spec/thinking_sphinx/index_spec.rb +39 -45
- data/spec/thinking_sphinx/search_methods_spec.rb +33 -37
- data/spec/thinking_sphinx/search_spec.rb +269 -491
- data/spec/thinking_sphinx/source_spec.rb +48 -62
- data/spec/thinking_sphinx_spec.rb +49 -49
- data/tasks/distribution.rb +46 -0
- data/tasks/testing.rb +74 -0
- metadata +123 -199
- data/features/field_sorting.feature +0 -18
- data/features/thinking_sphinx/db/.gitignore +0 -1
- data/features/thinking_sphinx/db/fixtures/post_keywords.txt +0 -1
- data/features/thinking_sphinx/models/andrew.rb +0 -17
- data/lib/thinking-sphinx.rb +0 -1
- data/lib/thinking_sphinx/active_record/has_many_association_with_scopes.rb +0 -21
- data/lib/thinking_sphinx/bundled_search.rb +0 -40
- data/lib/thinking_sphinx/connection.rb +0 -71
- data/lib/thinking_sphinx/deltas/delete_job.rb +0 -16
- data/lib/thinking_sphinx/deltas/index_job.rb +0 -17
- data/lib/thinking_sphinx/rails_additions.rb +0 -181
- data/spec/fixtures/data.sql +0 -32
- data/spec/fixtures/database.yml.default +0 -3
- data/spec/fixtures/models.rb +0 -161
- data/spec/fixtures/structure.sql +0 -146
- data/spec/spec_helper.rb +0 -54
- data/spec/sphinx_helper.rb +0 -67
- data/spec/thinking_sphinx/adapters/abstract_adapter_spec.rb +0 -163
- data/spec/thinking_sphinx/connection_spec.rb +0 -77
- data/spec/thinking_sphinx/rails_additions_spec.rb +0 -203
data/README.textile
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
h1. Thinking Sphinx
|
2
2
|
|
3
|
+
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.
|
4
|
+
|
5
|
+
If you want to give this a spin, clone the repo, check out the rails3 branch, and run @rake build@ to generate the gem.
|
6
|
+
|
3
7
|
h2. Usage
|
4
8
|
|
5
9
|
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.
|
@@ -15,11 +19,11 @@ To quickly see if your system is ready to run the thinking sphinx specs, run the
|
|
15
19
|
To get the spec suite running, you will need to install the ginger gem:
|
16
20
|
|
17
21
|
<pre><code>sudo gem install ginger --source http://gemcutter.org</code></pre>
|
18
|
-
|
22
|
+
|
19
23
|
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.
|
20
24
|
|
21
25
|
<pre>
|
22
|
-
sudo gem install bluecloth cucumber yard jeweler rspec
|
26
|
+
sudo gem install bluecloth cucumber yard jeweler rspec
|
23
27
|
</pre>
|
24
28
|
|
25
29
|
Then set up your database:
|
@@ -28,7 +32,7 @@ Then set up your database:
|
|
28
32
|
cp spec/fixtures/database.yml.default spec/fixtures/database.yml &&
|
29
33
|
mysqladmin -u root create thinking_sphinx
|
30
34
|
</pre>
|
31
|
-
|
35
|
+
|
32
36
|
This last step can be done automatically by the contribute.rb script if all dependencies are met.
|
33
37
|
|
34
38
|
Make sure you don't have another Sphinx daemon (searchd) running. If you do, quit it with "rake ts:stop"
|
@@ -122,6 +126,7 @@ Since I first released this library, there's been quite a few people who have su
|
|
122
126
|
* Andrei Bocan
|
123
127
|
* László Bácsi
|
124
128
|
* Peter Wagenet
|
129
|
+
* Max Lapshin
|
125
130
|
* Martin Emde
|
126
131
|
* David Wennergren
|
127
132
|
* Mark Lane
|
@@ -162,51 +167,13 @@ Since I first released this library, there's been quite a few people who have su
|
|
162
167
|
* Edgars Beigarts
|
163
168
|
* Ivan Ukhov
|
164
169
|
* Tomáš Pospíšek
|
170
|
+
* Jeffrey Hardy
|
171
|
+
* David Heinemeier Hansson
|
172
|
+
* Jimmy Hsu
|
173
|
+
* Bruno Michel
|
174
|
+
* Joren De Groof
|
175
|
+
* Jan De Poorter
|
165
176
|
* Tom Stuart
|
166
177
|
* James Brooks
|
178
|
+
* Andrew Coldham
|
167
179
|
* Mark Dodwell
|
168
|
-
* Frédéric Malamitsas
|
169
|
-
* Jon Gubman
|
170
|
-
* Michael Schuerig
|
171
|
-
* Ben Hutton
|
172
|
-
* Alfonso Jiménez
|
173
|
-
* Szymon Nowak
|
174
|
-
* Keith Pitt
|
175
|
-
* Lee Capps
|
176
|
-
* Sam Goldstein
|
177
|
-
* Matt Todd
|
178
|
-
* Paco Guzmán
|
179
|
-
* Marcin Stecki
|
180
|
-
* Robert Glaser
|
181
|
-
* Paul Schyska
|
182
|
-
* Kirill Maximov
|
183
|
-
* Hans Hasselberg
|
184
|
-
* Robert Stern
|
185
|
-
* George Anderson
|
186
|
-
* Greg Weber
|
187
|
-
* Javier Ramírez
|
188
|
-
* Patrick Tulskie
|
189
|
-
* Konstantin Shabanov
|
190
|
-
* Clemens Kofler
|
191
|
-
* Ryan Mohr
|
192
|
-
* Alex Chee
|
193
|
-
* Bruno Santschi
|
194
|
-
* Lars Weiler
|
195
|
-
* Andrey Deryabin
|
196
|
-
* Andrew White
|
197
|
-
* Rémi Prévost
|
198
|
-
* Justin Tanner
|
199
|
-
* Josh Goebel
|
200
|
-
* Ngan Pham
|
201
|
-
* Martin Gordon
|
202
|
-
* Aaron Gibralter
|
203
|
-
* Pete Deffendol
|
204
|
-
* Tony Pitale
|
205
|
-
* Kenn Ejima
|
206
|
-
* Matthew Barnett
|
207
|
-
* Ilia Lobsanov
|
208
|
-
* Andrew Hunter
|
209
|
-
* Simon Hürlimann
|
210
|
-
* Nathan Smith
|
211
|
-
* Cedric Maion
|
212
|
-
* George Ogata
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.0.0.rc1
|
@@ -2,21 +2,21 @@ Feature: Handle not-quite-supported column types as attributes
|
|
2
2
|
In order for Thinking Sphinx to be more understanding with model structures
|
3
3
|
The plugin
|
4
4
|
Should be able to use translatable columns as attributes
|
5
|
-
|
5
|
+
|
6
6
|
Scenario: Decimals as floats
|
7
7
|
Given Sphinx is running
|
8
8
|
And I am searching on alphas
|
9
9
|
When I filter between 1.0 and 3.0 on cost
|
10
10
|
Then I should get 2 results
|
11
|
-
|
11
|
+
|
12
12
|
Scenario: Dates as Datetimes
|
13
13
|
Given Sphinx is running
|
14
14
|
And I am searching on alphas
|
15
|
-
When I filter between
|
16
|
-
Then I should get
|
17
|
-
|
15
|
+
When I filter between 1 and 3 days ago on created_on
|
16
|
+
Then I should get 2 results
|
17
|
+
|
18
18
|
Scenario: Timestamps as Datetimes
|
19
19
|
Given Sphinx is running
|
20
20
|
And I am searching on alphas
|
21
|
-
When I filter between
|
22
|
-
Then I should get 2 results
|
21
|
+
When I filter between 1 and 3 days ago on created_at
|
22
|
+
Then I should get 2 results
|
@@ -2,13 +2,13 @@ Feature: Update attributes directly to Sphinx
|
|
2
2
|
In order for updates to be more seamless
|
3
3
|
The plugin
|
4
4
|
Should update Sphinx's attributes where possible
|
5
|
-
|
5
|
+
|
6
6
|
Scenario: Updating attributes in Sphinx without delta indexes
|
7
7
|
Given Sphinx is running
|
8
8
|
And I am searching on alphas
|
9
9
|
When I filter by 3 on value
|
10
10
|
Then I should get 1 result
|
11
|
-
|
11
|
+
|
12
12
|
When I change the value of alpha four to 13
|
13
13
|
And I wait for Sphinx to catch up
|
14
14
|
And I filter by 13 on value
|
@@ -16,7 +16,7 @@ Feature: Update attributes directly to Sphinx
|
|
16
16
|
Then I should get 1 result
|
17
17
|
When I use index alternative_core
|
18
18
|
Then I should get 1 result
|
19
|
-
|
19
|
+
|
20
20
|
When I change the value of alpha four to 4
|
21
21
|
And I wait for Sphinx to catch up
|
22
22
|
And I filter by 13 on value
|
@@ -30,49 +30,47 @@ Feature: Update attributes directly to Sphinx
|
|
30
30
|
And I am searching on betas
|
31
31
|
When I filter by 8 on value
|
32
32
|
Then I should get 1 result
|
33
|
-
|
33
|
+
|
34
34
|
When I change the value of beta eight to 18
|
35
35
|
And I wait for Sphinx to catch up
|
36
36
|
And I filter by 18 on value
|
37
37
|
Then I should get 1 result
|
38
|
-
|
39
|
-
When I search for the document id of beta eight in the
|
38
|
+
|
39
|
+
When I search for the document id of beta eight in the beta_delta index
|
40
40
|
Then it should not exist
|
41
|
-
|
41
|
+
|
42
42
|
Scenario: Updating attributes in a delta index
|
43
43
|
Given Sphinx is running
|
44
44
|
And I am searching on betas
|
45
|
-
|
45
|
+
|
46
46
|
When I change the name of beta nine to nineteen
|
47
47
|
And I change the value of beta nineteen to 19
|
48
48
|
And I wait for Sphinx to catch up
|
49
|
-
|
49
|
+
|
50
50
|
When I filter by 19 on value
|
51
|
-
And I use index
|
52
|
-
And I clear the connection pool
|
51
|
+
And I use index beta_delta
|
53
52
|
Then I should get 1 result
|
54
|
-
|
53
|
+
|
55
54
|
Scenario: Updating attributes in a delta index with deltas disabled
|
56
55
|
Given Sphinx is running
|
57
56
|
And I am searching on betas
|
58
|
-
|
57
|
+
|
59
58
|
When I change the name of beta eleven to twentyone
|
60
59
|
And I disable delta updates
|
61
60
|
And I change the value of beta twentyone to 21
|
62
61
|
And I wait for Sphinx to catch up
|
63
|
-
|
64
|
-
|
62
|
+
|
65
63
|
When I filter by 21 on value
|
66
|
-
And I use index
|
64
|
+
And I use index beta_delta
|
67
65
|
Then I should get 1 result
|
68
66
|
And I enable delta updates
|
69
|
-
|
67
|
+
|
70
68
|
Scenario: Updating boolean attribute in Sphinx
|
71
69
|
Given Sphinx is running
|
72
70
|
And I am searching on alphas
|
73
71
|
When I filter by active alphas
|
74
72
|
Then I should get 10 results
|
75
|
-
|
73
|
+
|
76
74
|
When I flag alpha five as inactive
|
77
75
|
And I wait for Sphinx to catch up
|
78
76
|
And I filter by active alphas
|
@@ -2,52 +2,50 @@ Feature: Keeping Sphinx in line with deleted model instances
|
|
2
2
|
In order to avoid deleted items being returned by Sphinx
|
3
3
|
Thinking Sphinx
|
4
4
|
Should keep deleted items out of search results
|
5
|
-
|
5
|
+
|
6
6
|
Scenario: Deleting instances from the core index
|
7
7
|
Given Sphinx is running
|
8
8
|
And I am searching on betas
|
9
9
|
When I search for three
|
10
10
|
Then I should get 1 result
|
11
|
-
|
11
|
+
|
12
12
|
When I destroy beta three
|
13
13
|
And I wait for Sphinx to catch up
|
14
14
|
And I search for three
|
15
15
|
Then I should get 0 results
|
16
|
-
|
16
|
+
|
17
17
|
Scenario: Deleting subclasses when the parent class is indexed
|
18
18
|
Given Sphinx is running
|
19
19
|
And I am searching on cats
|
20
20
|
When I search for moggy
|
21
21
|
Then I should get 1 result
|
22
|
-
|
22
|
+
|
23
23
|
When I destroy cat moggy
|
24
24
|
And I wait for Sphinx to catch up
|
25
25
|
And I search for moggy
|
26
26
|
Then I should get 0 results
|
27
|
-
|
27
|
+
|
28
28
|
Scenario: Deleting created instances from the delta index
|
29
29
|
Given Sphinx is running
|
30
30
|
And I am searching on betas
|
31
|
-
When I create a new beta named
|
31
|
+
When I create a new beta named eleven
|
32
32
|
And I wait for Sphinx to catch up
|
33
|
-
And I
|
34
|
-
And I search for eighteen
|
33
|
+
And I search for eleven
|
35
34
|
Then I should get 1 result
|
36
|
-
|
37
|
-
When I destroy beta
|
35
|
+
|
36
|
+
When I destroy beta eleven
|
38
37
|
And I wait for Sphinx to catch up
|
39
|
-
And I search for
|
38
|
+
And I search for eleven
|
40
39
|
Then I should get 0 results
|
41
|
-
|
40
|
+
|
42
41
|
Scenario: Deleting edited instances from the delta index
|
43
42
|
Given Sphinx is running
|
44
43
|
And I am searching on betas
|
45
44
|
When I change the name of beta four to fourteen
|
46
45
|
And I wait for Sphinx to catch up
|
47
|
-
And I clear the connection pool
|
48
46
|
And I search for fourteen
|
49
47
|
Then I should get 1 result
|
50
|
-
|
48
|
+
|
51
49
|
When I destroy beta fourteen
|
52
50
|
And I wait for Sphinx to catch up
|
53
51
|
And I search for fourteen
|
@@ -58,10 +56,9 @@ Feature: Keeping Sphinx in line with deleted model instances
|
|
58
56
|
And I am searching on betas
|
59
57
|
When I create a new beta named thirteen
|
60
58
|
And I wait for Sphinx to catch up
|
61
|
-
And I clear the connection pool
|
62
59
|
And I search for thirteen
|
63
60
|
Then I should get 1 result
|
64
|
-
|
61
|
+
|
65
62
|
And I disable delta updates
|
66
63
|
And I destroy beta thirteen
|
67
64
|
And I wait for Sphinx to catch up
|
data/features/excerpts.feature
CHANGED
@@ -11,11 +11,3 @@ Feature: Generate excerpts for search results
|
|
11
11
|
And I am searching on comments
|
12
12
|
And I search for "lorem"
|
13
13
|
Then calling content on the first result excerpts object should return "de un sitio mientras que mira su diseño. El punto de usar <span class="match">Lorem</span> Ipsum es que tiene una distribución"
|
14
|
-
|
15
|
-
Scenario: Excerpt Options
|
16
|
-
Given Sphinx is running
|
17
|
-
And I am searching on comments
|
18
|
-
And I search for "lorem"
|
19
|
-
And I provide excerpt option "before_match" with value "<em>"
|
20
|
-
And I provide excerpt option "after_match" with value "</em>"
|
21
|
-
Then calling content on the first result excerpts object should return "de un sitio mientras que mira su diseño. El punto de usar <em>Lorem</em> Ipsum es que tiene una distribución"
|
data/features/facets.feature
CHANGED
@@ -1,10 +1,8 @@
|
|
1
1
|
Feature: Search and browse models by their defined facets
|
2
2
|
|
3
|
-
Background:
|
4
|
-
Given Sphinx is running
|
5
|
-
|
6
3
|
Scenario: Requesting facets
|
7
|
-
Given
|
4
|
+
Given Sphinx is running
|
5
|
+
And I am searching on developers
|
8
6
|
When I am requesting facet results
|
9
7
|
Then I should have valid facet results
|
10
8
|
And I should have 6 facets
|
@@ -16,7 +14,8 @@ Feature: Search and browse models by their defined facets
|
|
16
14
|
And I should have the facet Tags
|
17
15
|
|
18
16
|
Scenario: Requesting specific facets
|
19
|
-
Given
|
17
|
+
Given Sphinx is running
|
18
|
+
And I am searching on developers
|
20
19
|
When I am requesting facet results
|
21
20
|
And I am requesting just the facet State
|
22
21
|
Then I should have valid facet results
|
@@ -28,26 +27,30 @@ Feature: Search and browse models by their defined facets
|
|
28
27
|
And I should have the facet State
|
29
28
|
And I should have the facet Age
|
30
29
|
|
31
|
-
Scenario:
|
32
|
-
Given
|
30
|
+
Scenario: Requseting float facets
|
31
|
+
Given Sphinx is running
|
32
|
+
And I am searching on alphas
|
33
33
|
When I am requesting facet results
|
34
34
|
Then I should have 1 facet
|
35
35
|
And the Cost facet should have a 5.55 key
|
36
36
|
|
37
37
|
Scenario: Requesting facet results
|
38
|
-
Given
|
38
|
+
Given Sphinx is running
|
39
|
+
And I am searching on developers
|
39
40
|
When I am requesting facet results
|
40
41
|
And I drill down where Country is Australia
|
41
42
|
Then I should get 11 results
|
42
43
|
|
43
44
|
Scenario: Requesting facet results by multiple facets
|
44
|
-
Given
|
45
|
+
Given Sphinx is running
|
46
|
+
And I am searching on developers
|
45
47
|
When I am requesting facet results
|
46
48
|
And I drill down where Country is Australia and Age is 30
|
47
49
|
Then I should get 4 results
|
48
50
|
|
49
51
|
Scenario: Requesting facets with classes included
|
50
|
-
Given
|
52
|
+
Given Sphinx is running
|
53
|
+
And I am searching on developers
|
51
54
|
When I am requesting facet results
|
52
55
|
And I want classes included
|
53
56
|
Then I should have valid facet results
|
@@ -55,7 +58,8 @@ Feature: Search and browse models by their defined facets
|
|
55
58
|
And I should have the facet Class
|
56
59
|
|
57
60
|
Scenario: Requesting MVA facets
|
58
|
-
Given
|
61
|
+
Given Sphinx is running
|
62
|
+
And I am searching on developers
|
59
63
|
When I am requesting facet results
|
60
64
|
And I drill down where tag_ids includes the id of tag Australia
|
61
65
|
Then I should get 11 results
|
@@ -64,25 +68,15 @@ Feature: Search and browse models by their defined facets
|
|
64
68
|
Then I should get 5 results
|
65
69
|
|
66
70
|
Scenario: Requesting MVA string facets
|
67
|
-
Given
|
71
|
+
Given Sphinx is running
|
72
|
+
And I am searching on developers
|
68
73
|
When I am requesting facet results
|
69
74
|
Then the Tags facet should have an "Australia" key
|
70
75
|
Then the Tags facet should have an "Melbourne" key
|
71
76
|
Then the Tags facet should have an "Victoria" key
|
72
77
|
|
73
78
|
Scenario: Requesting MVA facets from source queries
|
74
|
-
Given
|
79
|
+
Given Sphinx is running
|
80
|
+
And I am searching on posts
|
75
81
|
When I am requesting facet results
|
76
82
|
Then the Comment Ids facet should have 9 keys
|
77
|
-
|
78
|
-
Scenario: Requesting facets from a subclass
|
79
|
-
Given I am searching on animals
|
80
|
-
When I am requesting facet results
|
81
|
-
And I want classes included
|
82
|
-
Then I should have the facet Class
|
83
|
-
|
84
|
-
Scenario: Requesting facets with explicit value sources
|
85
|
-
Given I am searching on developers
|
86
|
-
When I am requesting facet results
|
87
|
-
Then the City facet should have a "Melbourne" key
|
88
|
-
|
@@ -2,75 +2,70 @@ Feature: Keeping Sphinx in line with model changes when requested
|
|
2
2
|
In order to keep indexes as up to date as possible
|
3
3
|
Thinking Sphinx
|
4
4
|
Should return the expected results depending on whether delta indexes are used
|
5
|
-
|
5
|
+
|
6
6
|
Scenario: Returning instance from old data if there is no delta
|
7
7
|
Given Sphinx is running
|
8
8
|
And I am searching on alphas
|
9
9
|
When I search for two
|
10
10
|
Then I should get 1 result
|
11
|
-
|
11
|
+
|
12
12
|
When I change the name of alpha two to twelve
|
13
13
|
And I wait for Sphinx to catch up
|
14
14
|
And I search for two
|
15
15
|
Then I should get 1 result
|
16
|
-
|
16
|
+
|
17
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
|
21
21
|
Then I should get 1 result
|
22
|
-
|
22
|
+
|
23
23
|
When I change the name of beta two to twelve
|
24
24
|
And I wait for Sphinx to catch up
|
25
|
-
And I clear the connection pool
|
26
25
|
And I search for two
|
27
26
|
Then I should get 0 results
|
28
|
-
|
27
|
+
|
29
28
|
Scenario: Returning instance from new data if there is a delta
|
30
29
|
Given Sphinx is running
|
31
30
|
And I am searching on betas
|
32
31
|
When I search for one
|
33
32
|
Then I should get 1 result
|
34
|
-
|
35
|
-
When I change the name of beta one to
|
33
|
+
|
34
|
+
When I change the name of beta one to eleven
|
36
35
|
And I wait for Sphinx to catch up
|
37
|
-
And I clear the connection pool
|
38
36
|
And I search for one
|
39
37
|
Then I should get 0 results
|
40
|
-
|
41
|
-
When I search for
|
38
|
+
|
39
|
+
When I search for eleven
|
42
40
|
Then I should get 1 result
|
43
|
-
|
41
|
+
|
44
42
|
Scenario: Returning new records if there's a delta
|
45
43
|
Given Sphinx is running
|
46
44
|
And I am searching on betas
|
47
45
|
When I search for fifteen
|
48
46
|
Then I should get 0 results
|
49
|
-
|
47
|
+
|
50
48
|
When I create a new beta named fifteen
|
51
49
|
And I wait for Sphinx to catch up
|
52
|
-
And I clear the connection pool
|
53
50
|
And I search for fifteen
|
54
51
|
Then I should get 1 result
|
55
|
-
|
52
|
+
|
56
53
|
Scenario: Avoiding delta updates if there hasn't been changes
|
57
54
|
Given Sphinx is running
|
58
55
|
And I am searching on betas
|
59
56
|
When I search for five
|
60
57
|
Then I should get 1 result
|
61
|
-
|
58
|
+
|
62
59
|
When I change the name of beta five to five
|
63
60
|
And I wait for Sphinx to catch up
|
64
61
|
And I search for five
|
65
62
|
Then I should get 1 result
|
66
|
-
|
63
|
+
|
67
64
|
When I search for the document id of beta five in the beta_core index
|
68
65
|
Then it should exist if using Rails 2.1 or newer
|
69
|
-
When I search for the document id of beta five in the
|
70
|
-
Then it should exist if using Rails 2.1 or newer
|
71
|
-
When I search for the document id of beta five in the secondary_beta_delta index
|
66
|
+
When I search for the document id of beta five in the beta_delta index
|
72
67
|
Then it should not exist if using Rails 2.1 or newer
|
73
|
-
|
68
|
+
|
74
69
|
Scenario: Handling edits with a delta when Sphinx isn't running
|
75
70
|
Given Sphinx is running
|
76
71
|
And I am searching on betas
|
@@ -79,19 +74,19 @@ Feature: Keeping Sphinx in line with model changes when requested
|
|
79
74
|
And I start Sphinx
|
80
75
|
And I search for sixteen
|
81
76
|
Then I should get 1 result
|
82
|
-
|
77
|
+
|
83
78
|
Scenario: Handling edits when updates are disabled
|
84
79
|
Given Sphinx is running
|
85
80
|
And updates are disabled
|
86
81
|
And I am searching on betas
|
87
|
-
|
82
|
+
|
88
83
|
When I search for seven
|
89
84
|
Then I should get 1 result
|
90
|
-
|
85
|
+
|
91
86
|
When I change the name of beta seven to seventeen
|
92
87
|
And I wait for Sphinx to catch up
|
93
88
|
And I search for seven
|
94
89
|
Then I should get 1 result
|
95
|
-
|
90
|
+
|
96
91
|
When I search for seventeen
|
97
92
|
Then I should get 0 results
|