thinking-sphinx-099 1.2.12 → 1.2.13
Sign up to get free protection for your applications and to get access to all the features.
- data/README.textile +4 -17
- data/VERSION.yml +2 -1
- 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 +76 -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 +174 -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/database.example.yml +3 -0
- data/features/support/database.yml +5 -0
- data/features/support/db/active_record.rb +40 -0
- data/features/support/db/database.yml +5 -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 +4 -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 +18 -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 +12 -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/lib/cucumber/thinking_sphinx/internal_world.rb +125 -0
- data/lib/cucumber/thinking_sphinx/sql_logger.rb +20 -0
- data/lib/thinking_sphinx.rb +4 -2
- data/lib/thinking_sphinx/active_record.rb +1 -2
- data/lib/thinking_sphinx/adapters/mysql_adapter.rb +1 -1
- data/lib/thinking_sphinx/adapters/postgresql_adapter.rb +18 -11
- data/lib/thinking_sphinx/attribute.rb +3 -4
- data/lib/thinking_sphinx/excerpter.rb +1 -1
- data/lib/thinking_sphinx/search.rb +1 -0
- data/lib/thinking_sphinx/source.rb +1 -1
- data/spec/lib/thinking_sphinx/active_record_spec.rb +0 -11
- data/spec/lib/thinking_sphinx/attribute_spec.rb +14 -7
- data/spec/lib/thinking_sphinx/deltas/job_spec.rb +32 -0
- data/spec/lib/thinking_sphinx/excerpter_spec.rb +8 -0
- data/spec/lib/thinking_sphinx/search_spec.rb +9 -0
- data/tasks/distribution.rb +4 -1
- data/tasks/testing.rb +8 -19
- metadata +99 -2
data/README.textile
CHANGED
@@ -12,24 +12,9 @@ Fork on GitHub and after you've committed tested patches, send a pull request.
|
|
12
12
|
|
13
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
14
|
|
15
|
-
To get the spec suite running, you will need to install the
|
15
|
+
To get the spec suite running, you will need to install the ginger gem:
|
16
16
|
|
17
|
-
|
18
|
-
cd not-a-mock
|
19
|
-
rake gem
|
20
|
-
gem install pkg/not_a_mock-1.1.0.gem
|
21
|
-
|
22
|
-
Then install the ginger gem. The steps are the same, except that you might need to sudo the gem install:
|
23
|
-
|
24
|
-
git clone git://github.com/freelancing-god/ginger.git
|
25
|
-
cd ginger
|
26
|
-
rake gem
|
27
|
-
sudo gem install pkg/ginger-1.1.0.gem
|
28
|
-
|
29
|
-
Alternatively, install the ginger gem directly from the freelancing-god github repository
|
30
|
-
|
31
|
-
sudo gem sources -a http://gems.github.com
|
32
|
-
sudo gem install freelancing-god-ginger
|
17
|
+
sudo gem install ginger --source http://gemcutter.org
|
33
18
|
|
34
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.
|
35
20
|
|
@@ -155,3 +140,5 @@ Since I first released this library, there's been quite a few people who have su
|
|
155
140
|
* Ward Bekker
|
156
141
|
* Brian Terlson
|
157
142
|
* Christian Aust
|
143
|
+
* Martin Sarasale
|
144
|
+
* Édouard Brière
|
data/VERSION.yml
CHANGED
@@ -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
|
@@ -0,0 +1,11 @@
|
|
1
|
+
Feature: Direct Attributes
|
2
|
+
In order to avoid unnecessary SQL queries
|
3
|
+
I want to access attribute values from Sphinx's response
|
4
|
+
|
5
|
+
Scenario: Accessing attribute values directly
|
6
|
+
Given Sphinx is running
|
7
|
+
And I am searching on posts
|
8
|
+
When I search
|
9
|
+
Then the first result should have a comments count of 9
|
10
|
+
|
11
|
+
|
@@ -0,0 +1,13 @@
|
|
1
|
+
Feature: Generate excerpts for search results
|
2
|
+
|
3
|
+
Scenario: Basic Excerpts Syntax
|
4
|
+
Given Sphinx is running
|
5
|
+
And I am searching on comments
|
6
|
+
And I search for "lorem punto"
|
7
|
+
Then the content excerpt of the first result is "de un sitio mientras que mira su diseño. El <span class="match">punto</span> de usar <span class="match">Lorem</span> Ipsum es que tiene una distribución"
|
8
|
+
|
9
|
+
Scenario: Integrated Excerpts Syntax
|
10
|
+
Given Sphinx is running
|
11
|
+
And I am searching on comments
|
12
|
+
And I search for "lorem"
|
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"
|
@@ -0,0 +1,9 @@
|
|
1
|
+
Feature: Delayed Delta Indexing
|
2
|
+
In order to have delta indexing on frequently-updated sites
|
3
|
+
Developers
|
4
|
+
Should be able to create their own handlers for delta indexing
|
5
|
+
|
6
|
+
Scenario: I specify a valid handler for delta indexing
|
7
|
+
Given Sphinx is running
|
8
|
+
When I change the name of extensible beta one to eleven
|
9
|
+
Then the generic delta handler should handle the delta indexing
|
@@ -0,0 +1,76 @@
|
|
1
|
+
Feature: Search and browse models by their defined facets
|
2
|
+
|
3
|
+
Scenario: Requesting facets
|
4
|
+
Given Sphinx is running
|
5
|
+
And I am searching on developers
|
6
|
+
When I am requesting facet results
|
7
|
+
Then I should have valid facet results
|
8
|
+
And I should have 6 facets
|
9
|
+
And I should have the facet State
|
10
|
+
And I should have the facet Country
|
11
|
+
And I should have the facet Age
|
12
|
+
And I should have the facet City
|
13
|
+
And I should have the facet Tag Ids
|
14
|
+
And I should have the facet Tags
|
15
|
+
|
16
|
+
Scenario: Requesting specific facets
|
17
|
+
Given Sphinx is running
|
18
|
+
And I am searching on developers
|
19
|
+
When I am requesting facet results
|
20
|
+
And I am requesting just the facet State
|
21
|
+
Then I should have valid facet results
|
22
|
+
And I should have 1 facet
|
23
|
+
And I should have the facet State
|
24
|
+
When I am requesting just the facets State and Age
|
25
|
+
Then I should have valid facet results
|
26
|
+
And I should have 2 facet
|
27
|
+
And I should have the facet State
|
28
|
+
And I should have the facet Age
|
29
|
+
|
30
|
+
Scenario: Requseting float facets
|
31
|
+
Given Sphinx is running
|
32
|
+
And I am searching on alphas
|
33
|
+
When I am requesting facet results
|
34
|
+
Then I should have 1 facet
|
35
|
+
And the Cost facet should have a 5.55 key
|
36
|
+
|
37
|
+
Scenario: Requesting facet results
|
38
|
+
Given Sphinx is running
|
39
|
+
And I am searching on developers
|
40
|
+
When I am requesting facet results
|
41
|
+
And I drill down where Country is Australia
|
42
|
+
Then I should get 11 results
|
43
|
+
|
44
|
+
Scenario: Requesting facet results by multiple facets
|
45
|
+
Given Sphinx is running
|
46
|
+
And I am searching on developers
|
47
|
+
When I am requesting facet results
|
48
|
+
And I drill down where Country is Australia and Age is 30
|
49
|
+
Then I should get 4 results
|
50
|
+
|
51
|
+
Scenario: Requesting facets with classes included
|
52
|
+
Given Sphinx is running
|
53
|
+
And I am searching on developers
|
54
|
+
When I am requesting facet results
|
55
|
+
And I want classes included
|
56
|
+
Then I should have valid facet results
|
57
|
+
And I should have 7 facets
|
58
|
+
And I should have the facet Class
|
59
|
+
|
60
|
+
Scenario: Requesting MVA facets
|
61
|
+
Given Sphinx is running
|
62
|
+
And I am searching on developers
|
63
|
+
When I am requesting facet results
|
64
|
+
And I drill down where tag_ids includes the id of tag Australia
|
65
|
+
Then I should get 11 results
|
66
|
+
When I am requesting facet results
|
67
|
+
And I drill down where tag_ids includes the id of tags Melbourne or Sydney
|
68
|
+
Then I should get 5 results
|
69
|
+
|
70
|
+
Scenario: Requesting MVA string facets
|
71
|
+
Given Sphinx is running
|
72
|
+
And I am searching on developers
|
73
|
+
When I am requesting facet results
|
74
|
+
Then the Tags facet should have an "Australia" key
|
75
|
+
Then the Tags facet should have an "Melbourne" key
|
76
|
+
Then the Tags facet should have an "Victoria" key
|
@@ -0,0 +1,29 @@
|
|
1
|
+
Feature: Search and browse across models by their defined facets
|
2
|
+
|
3
|
+
Scenario: Requesting facets across multiple models
|
4
|
+
Given Sphinx is running
|
5
|
+
When I am requesting facet results
|
6
|
+
And I want all possible attributes
|
7
|
+
Then I should have valid facet results
|
8
|
+
And I should have 10 facets
|
9
|
+
And I should have the facet Class
|
10
|
+
And the Class facet should have a "Person" key
|
11
|
+
And I should have the facet Gender
|
12
|
+
And the Gender facet should have a "female" key
|
13
|
+
And I should have the facet Country
|
14
|
+
And I should have the facet Category Name
|
15
|
+
And the Category Name facet should have a "hello" key with 10 hits
|
16
|
+
|
17
|
+
Scenario: Requesting facets across models without class results
|
18
|
+
Given Sphinx is running
|
19
|
+
When I am requesting facet results
|
20
|
+
And I want all possible attributes
|
21
|
+
And I don't want classes included
|
22
|
+
Then I should have 9 facets
|
23
|
+
And I should not have the facet Class
|
24
|
+
|
25
|
+
Scenario: Requesting facets common to all indexed models
|
26
|
+
Given Sphinx is running
|
27
|
+
When I am requesting facet results
|
28
|
+
Then I should have the facet Class
|
29
|
+
And I should have 1 facet
|
@@ -0,0 +1,76 @@
|
|
1
|
+
Feature: Keeping Sphinx in line with model changes when requested
|
2
|
+
In order to keep indexes as up to date as possible
|
3
|
+
Thinking Sphinx
|
4
|
+
Should return the expected results depending on whether delta indexes are used
|
5
|
+
|
6
|
+
Scenario: Returning instance from old data if there is no delta
|
7
|
+
Given Sphinx is running
|
8
|
+
And I am searching on alphas
|
9
|
+
When I search for two
|
10
|
+
Then I should get 1 result
|
11
|
+
|
12
|
+
When I change the name of alpha two to twelve
|
13
|
+
And I wait for Sphinx to catch up
|
14
|
+
And I search for two
|
15
|
+
Then I should get 1 result
|
16
|
+
|
17
|
+
Scenario: Not returing an instance from old data if there is a delta
|
18
|
+
Given Sphinx is running
|
19
|
+
And I am searching on betas
|
20
|
+
When I search for two
|
21
|
+
Then I should get 1 result
|
22
|
+
|
23
|
+
When I change the name of beta two to twelve
|
24
|
+
And I wait for Sphinx to catch up
|
25
|
+
And I search for two
|
26
|
+
Then I should get 0 results
|
27
|
+
|
28
|
+
Scenario: Returning instance from new data if there is a delta
|
29
|
+
Given Sphinx is running
|
30
|
+
And I am searching on betas
|
31
|
+
When I search for one
|
32
|
+
Then I should get 1 result
|
33
|
+
|
34
|
+
When I change the name of beta one to eleven
|
35
|
+
And I wait for Sphinx to catch up
|
36
|
+
And I search for one
|
37
|
+
Then I should get 0 results
|
38
|
+
|
39
|
+
When I search for eleven
|
40
|
+
Then I should get 1 result
|
41
|
+
|
42
|
+
Scenario: Returning new records if there's a delta
|
43
|
+
Given Sphinx is running
|
44
|
+
And I am searching on betas
|
45
|
+
When I search for fifteen
|
46
|
+
Then I should get 0 results
|
47
|
+
|
48
|
+
When I create a new beta named fifteen
|
49
|
+
And I wait for Sphinx to catch up
|
50
|
+
And I search for fifteen
|
51
|
+
Then I should get 1 result
|
52
|
+
|
53
|
+
Scenario: Avoiding delta updates if there hasn't been changes
|
54
|
+
Given Sphinx is running
|
55
|
+
And I am searching on betas
|
56
|
+
When I search for five
|
57
|
+
Then I should get 1 result
|
58
|
+
|
59
|
+
When I change the name of beta five to five
|
60
|
+
And I wait for Sphinx to catch up
|
61
|
+
And I search for five
|
62
|
+
Then I should get 1 result
|
63
|
+
|
64
|
+
When I search for the document id of beta five in the beta_core index
|
65
|
+
Then it should exist if using Rails 2.1 or newer
|
66
|
+
When I search for the document id of beta five in the beta_delta index
|
67
|
+
Then it should not exist if using Rails 2.1 or newer
|
68
|
+
|
69
|
+
Scenario: Handling edits with a delta when Sphinx isn't running
|
70
|
+
Given Sphinx is running
|
71
|
+
And I am searching on betas
|
72
|
+
When I stop Sphinx
|
73
|
+
And I change the name of beta six to sixteen
|
74
|
+
And I start Sphinx
|
75
|
+
And I search for sixteen
|
76
|
+
Then I should get 1 result
|