sherpa99-thinking-sphinx 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/LICENCE +20 -0
- data/README +107 -0
- data/README.textile +107 -0
- data/Rakefile +4 -0
- data/contribute.rb +328 -0
- data/cucumber.yml +1 -0
- data/features/a.rb +17 -0
- data/features/attribute_transformation.feature +22 -0
- data/features/datetime_deltas.feature +55 -0
- data/features/delayed_delta_indexing.feature +37 -0
- data/features/deleting_instances.feature +52 -0
- data/features/facets.feature +26 -0
- data/features/handling_edits.feature +67 -0
- data/features/retry_stale_indexes.feature +24 -0
- data/features/searching_across_models.feature +20 -0
- data/features/searching_by_model.feature +118 -0
- data/features/searching_with_find_arguments.feature +56 -0
- data/features/sphinx_detection.feature +16 -0
- data/features/step_definitions/alpha_steps.rb +3 -0
- data/features/step_definitions/beta_steps.rb +11 -0
- data/features/step_definitions/cat_steps.rb +3 -0
- data/features/step_definitions/common_steps.rb +154 -0
- data/features/step_definitions/datetime_delta_steps.rb +11 -0
- data/features/step_definitions/delayed_delta_indexing_steps.rb +7 -0
- data/features/step_definitions/facet_steps.rb +30 -0
- data/features/step_definitions/find_arguments_steps.rb +36 -0
- data/features/step_definitions/gamma_steps.rb +15 -0
- data/features/step_definitions/search_steps.rb +66 -0
- data/features/step_definitions/sphinx_steps.rb +23 -0
- data/features/support/db/active_record.rb +40 -0
- data/features/support/db/database.example.yml +4 -0
- data/features/support/db/migrations/create_alphas.rb +18 -0
- data/features/support/db/migrations/create_animals.rb +9 -0
- data/features/support/db/migrations/create_betas.rb +15 -0
- data/features/support/db/migrations/create_boxes.rb +13 -0
- data/features/support/db/migrations/create_comments.rb +13 -0
- data/features/support/db/migrations/create_delayed_betas.rb +28 -0
- data/features/support/db/migrations/create_developers.rb +39 -0
- data/features/support/db/migrations/create_gammas.rb +14 -0
- data/features/support/db/migrations/create_people.rb +1014 -0
- data/features/support/db/migrations/create_posts.rb +6 -0
- data/features/support/db/migrations/create_thetas.rb +16 -0
- data/features/support/db/mysql.rb +4 -0
- data/features/support/db/postgresql.rb +4 -0
- data/features/support/env.rb +6 -0
- data/features/support/models/alpha.rb +9 -0
- data/features/support/models/animal.rb +5 -0
- data/features/support/models/beta.rb +7 -0
- data/features/support/models/box.rb +8 -0
- data/features/support/models/cat.rb +3 -0
- data/features/support/models/comment.rb +3 -0
- data/features/support/models/delayed_beta.rb +7 -0
- data/features/support/models/developer.rb +8 -0
- data/features/support/models/gamma.rb +5 -0
- data/features/support/models/person.rb +8 -0
- data/features/support/models/post.rb +8 -0
- data/features/support/models/theta.rb +7 -0
- data/features/support/post_database.rb +37 -0
- data/features/support/z.rb +19 -0
- data/ginger_scenarios.rb +24 -0
- data/init.rb +12 -0
- data/lib/thinking_sphinx.rb +144 -0
- data/lib/thinking_sphinx/active_record.rb +245 -0
- data/lib/thinking_sphinx/active_record/delta.rb +74 -0
- data/lib/thinking_sphinx/active_record/has_many_association.rb +29 -0
- data/lib/thinking_sphinx/active_record/search.rb +57 -0
- data/lib/thinking_sphinx/adapters/abstract_adapter.rb +34 -0
- data/lib/thinking_sphinx/adapters/mysql_adapter.rb +53 -0
- data/lib/thinking_sphinx/adapters/postgresql_adapter.rb +129 -0
- data/lib/thinking_sphinx/association.rb +144 -0
- data/lib/thinking_sphinx/attribute.rb +258 -0
- data/lib/thinking_sphinx/collection.rb +142 -0
- data/lib/thinking_sphinx/configuration.rb +236 -0
- data/lib/thinking_sphinx/core/string.rb +22 -0
- data/lib/thinking_sphinx/deltas.rb +22 -0
- data/lib/thinking_sphinx/deltas/datetime_delta.rb +50 -0
- data/lib/thinking_sphinx/deltas/default_delta.rb +65 -0
- data/lib/thinking_sphinx/deltas/delayed_delta.rb +25 -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/facet.rb +58 -0
- data/lib/thinking_sphinx/facet_collection.rb +44 -0
- data/lib/thinking_sphinx/field.rb +172 -0
- data/lib/thinking_sphinx/index.rb +414 -0
- data/lib/thinking_sphinx/index/builder.rb +233 -0
- data/lib/thinking_sphinx/index/faux_column.rb +110 -0
- data/lib/thinking_sphinx/rails_additions.rb +133 -0
- data/lib/thinking_sphinx/search.rb +638 -0
- data/lib/thinking_sphinx/tasks.rb +128 -0
- data/rails/init.rb +6 -0
- data/spec/fixtures/data.sql +32 -0
- data/spec/fixtures/database.yml.default +3 -0
- data/spec/fixtures/models.rb +81 -0
- data/spec/fixtures/structure.sql +84 -0
- data/spec/spec_helper.rb +54 -0
- data/spec/sphinx_helper.rb +109 -0
- data/spec/unit/thinking_sphinx/active_record/delta_spec.rb +136 -0
- data/spec/unit/thinking_sphinx/active_record/has_many_association_spec.rb +53 -0
- data/spec/unit/thinking_sphinx/active_record/search_spec.rb +107 -0
- data/spec/unit/thinking_sphinx/active_record_spec.rb +256 -0
- data/spec/unit/thinking_sphinx/association_spec.rb +247 -0
- data/spec/unit/thinking_sphinx/attribute_spec.rb +212 -0
- data/spec/unit/thinking_sphinx/collection_spec.rb +14 -0
- data/spec/unit/thinking_sphinx/configuration_spec.rb +136 -0
- data/spec/unit/thinking_sphinx/core/string_spec.rb +9 -0
- data/spec/unit/thinking_sphinx/field_spec.rb +145 -0
- data/spec/unit/thinking_sphinx/index/builder_spec.rb +5 -0
- data/spec/unit/thinking_sphinx/index/faux_column_spec.rb +30 -0
- data/spec/unit/thinking_sphinx/index_spec.rb +54 -0
- data/spec/unit/thinking_sphinx/search_spec.rb +59 -0
- data/spec/unit/thinking_sphinx_spec.rb +129 -0
- data/tasks/distribution.rb +48 -0
- data/tasks/rails.rake +1 -0
- data/tasks/testing.rb +86 -0
- data/thinking-sphinx.gemspec +232 -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 +5 -0
- data/vendor/after_commit/lib/after_commit.rb +42 -0
- data/vendor/after_commit/lib/after_commit/active_record.rb +91 -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 +619 -0
- data/vendor/riddle/lib/riddle/client/filter.rb +53 -0
- data/vendor/riddle/lib/riddle/client/message.rb +65 -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 +37 -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 +44 -0
- metadata +248 -0
data/cucumber.yml
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
default: "--require features/support/env.rb --require features/support/db/mysql.rb --require features/support/db/active_record.rb --require features/support/post_database.rb --require features/step_definitions/alpha_steps.rb --require features/step_definitions/beta_steps.rb --require features/step_definitions/cat_steps.rb --require features/step_definitions/common_steps.rb --require features/step_definitions/datetime_delta_steps.rb --require features/step_definitions/delayed_delta_indexing_steps.rb --require features/step_definitions/facet_steps.rb --require features/step_definitions/find_arguments_steps.rb --require features/step_definitions/gamma_steps.rb --require features/step_definitions/search_steps.rb --require features/step_definitions/sphinx_steps.rb"
|
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,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,55 @@
|
|
|
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
|
|
@@ -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,52 @@
|
|
|
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
|
|
@@ -0,0 +1,26 @@
|
|
|
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 4 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
|
+
|
|
14
|
+
Scenario: Requesting facet results
|
|
15
|
+
Given Sphinx is running
|
|
16
|
+
And I am searching on developers
|
|
17
|
+
When I am requesting facet results
|
|
18
|
+
And I drill down where Country is Australia
|
|
19
|
+
Then I should get 11 results
|
|
20
|
+
|
|
21
|
+
Scenario: Requesting facet results by multiple facets
|
|
22
|
+
Given Sphinx is running
|
|
23
|
+
And I am searching on developers
|
|
24
|
+
When I am requesting facet results
|
|
25
|
+
And I drill down where Country is Australia and Age is 30
|
|
26
|
+
Then I should get 4 results
|
|
@@ -0,0 +1,67 @@
|
|
|
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
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
Feature: Manually updating Sphinx indexes to handle uncaught deletions
|
|
2
|
+
In order to keep indexes as up to date as possible
|
|
3
|
+
Thinking Sphinx
|
|
4
|
+
Should automatically update the indexes and retry the search if it gets a nil result
|
|
5
|
+
|
|
6
|
+
Scenario: Changing retry_stale settings
|
|
7
|
+
Given Sphinx is running
|
|
8
|
+
And I am searching on gammas
|
|
9
|
+
Then I should not get 0 results
|
|
10
|
+
|
|
11
|
+
When I set retry stale to false
|
|
12
|
+
And I set per page to 1
|
|
13
|
+
And I order by "sphinx_internal_id ASC"
|
|
14
|
+
And I destroy gamma one without callbacks
|
|
15
|
+
Then I should get a single result of nil
|
|
16
|
+
|
|
17
|
+
When I set retry stale to 1
|
|
18
|
+
Then I should get a single gamma result with a name of two
|
|
19
|
+
|
|
20
|
+
When I destroy gamma two without callbacks
|
|
21
|
+
Then I should get a single result of nil
|
|
22
|
+
|
|
23
|
+
When I set retry stale to true
|
|
24
|
+
Then I should get a single gamma result with a name of three
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Feature: Searching across multiple model
|
|
2
|
+
In order to use Thinking Sphinx's core functionality
|
|
3
|
+
A developer
|
|
4
|
+
Should be able to search on multiple models
|
|
5
|
+
|
|
6
|
+
Scenario: Retrieving total result count
|
|
7
|
+
Given Sphinx is running
|
|
8
|
+
When I search for James
|
|
9
|
+
And I am retrieving the result count
|
|
10
|
+
Then I should get a value of 3
|
|
11
|
+
|
|
12
|
+
Scenario: Confirming existance of a document id in a given index
|
|
13
|
+
Given Sphinx is running
|
|
14
|
+
When I search for the document id of alpha one in the alpha_core index
|
|
15
|
+
Then it should exist
|
|
16
|
+
|
|
17
|
+
Scenario: Retrieving results from multiple models
|
|
18
|
+
Given Sphinx is running
|
|
19
|
+
When I search for ten
|
|
20
|
+
Then I should get 5 results
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
Feature: Searching on a single model
|
|
2
|
+
In order to use Thinking Sphinx's core functionality
|
|
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 people
|
|
9
|
+
When I search for James
|
|
10
|
+
Then I should get 3 results
|
|
11
|
+
|
|
12
|
+
Scenario: Searching on a specific field
|
|
13
|
+
Given Sphinx is running
|
|
14
|
+
And I am searching on people
|
|
15
|
+
When I search for James on first_name
|
|
16
|
+
Then I should get 2 results
|
|
17
|
+
|
|
18
|
+
Scenario: Searching on multiple fields
|
|
19
|
+
Given Sphinx is running
|
|
20
|
+
And I am searching on people
|
|
21
|
+
When I search for James on first_name
|
|
22
|
+
And I search for Chamberlain on last_name
|
|
23
|
+
Then I should get 1 result
|
|
24
|
+
|
|
25
|
+
Scenario: Searching with a filter
|
|
26
|
+
Given Sphinx is running
|
|
27
|
+
And I am searching on alphas
|
|
28
|
+
When I filter by 1 on value
|
|
29
|
+
Then I should get 1 result
|
|
30
|
+
|
|
31
|
+
Scenario: Searching with multiple filters
|
|
32
|
+
Given Sphinx is running
|
|
33
|
+
And I am searching on boxes
|
|
34
|
+
When I filter by 2 on width
|
|
35
|
+
And I filter by 2 on length
|
|
36
|
+
Then I should get 1 result
|
|
37
|
+
|
|
38
|
+
Scenario: Searching to filter multiple values on an MVA
|
|
39
|
+
Given Sphinx is running
|
|
40
|
+
And I am searching on boxes
|
|
41
|
+
When I filter by 11 and 12 on dimensions
|
|
42
|
+
Then I should get 2 results
|
|
43
|
+
When I clear existing filters
|
|
44
|
+
And I filter by both 11 and 12 on dimensions
|
|
45
|
+
Then I should get 1 result
|
|
46
|
+
|
|
47
|
+
Scenario: Searching with ordering by attribute
|
|
48
|
+
Given Sphinx is running
|
|
49
|
+
And I am searching on alphas
|
|
50
|
+
When I order by value
|
|
51
|
+
Then I should get 10 results
|
|
52
|
+
And the value of each result should indicate order
|
|
53
|
+
|
|
54
|
+
Scenario: Searching with ordering on a sortable field
|
|
55
|
+
Given Sphinx is running
|
|
56
|
+
And I am searching on people
|
|
57
|
+
And I order by first_name
|
|
58
|
+
Then I should get 20 results
|
|
59
|
+
And the first_name of each result should indicate order
|
|
60
|
+
|
|
61
|
+
Scenario: Intepreting Sphinx Internal Identifiers
|
|
62
|
+
Given Sphinx is running
|
|
63
|
+
And I am searching on people
|
|
64
|
+
Then I should get 20 results
|
|
65
|
+
And each result id should match the corresponding sphinx internal id
|
|
66
|
+
|
|
67
|
+
Scenario: Retrieving weightings
|
|
68
|
+
Given Sphinx is running
|
|
69
|
+
And I am searching on people
|
|
70
|
+
When I search for "Ellie Ford"
|
|
71
|
+
And I set match mode to any
|
|
72
|
+
Then I can iterate by result and weighting
|
|
73
|
+
|
|
74
|
+
Scenario: Retrieving group counts
|
|
75
|
+
Given Sphinx is running
|
|
76
|
+
And I am searching on people
|
|
77
|
+
When I group results by the birthday attribute
|
|
78
|
+
Then I can iterate by result and count
|
|
79
|
+
|
|
80
|
+
Scenario: Retrieving group values
|
|
81
|
+
Given Sphinx is running
|
|
82
|
+
And I am searching on people
|
|
83
|
+
When I group results by the birthday attribute
|
|
84
|
+
Then I can iterate by result and group
|
|
85
|
+
|
|
86
|
+
Scenario: Retrieving both group values and counts
|
|
87
|
+
Given Sphinx is running
|
|
88
|
+
And I am searching on people
|
|
89
|
+
When I group results by the birthday attribute
|
|
90
|
+
Then I can iterate by result and group and count
|
|
91
|
+
|
|
92
|
+
Scenario: Searching for ids
|
|
93
|
+
Given Sphinx is running
|
|
94
|
+
And I am searching on people
|
|
95
|
+
When I search for Ellie
|
|
96
|
+
And I am searching for ids
|
|
97
|
+
Then I should have an array of integers
|
|
98
|
+
|
|
99
|
+
Scenario: Search results should match Sphinx's order
|
|
100
|
+
Given Sphinx is running
|
|
101
|
+
And I am searching on people
|
|
102
|
+
When I search for Ellie
|
|
103
|
+
And I order by "sphinx_internal_id DESC"
|
|
104
|
+
Then searching for ids should match the record ids of the normal search results
|
|
105
|
+
|
|
106
|
+
Scenario: Retrieving total result count when total is less than a page
|
|
107
|
+
Given Sphinx is running
|
|
108
|
+
And I am searching on people
|
|
109
|
+
When I search for James
|
|
110
|
+
And I am retrieving the result count
|
|
111
|
+
Then I should get a value of 3
|
|
112
|
+
|
|
113
|
+
Scenario: Retrieving total result count for more than a page
|
|
114
|
+
Given Sphinx is running
|
|
115
|
+
And I am searching on people
|
|
116
|
+
When I am retrieving the result count
|
|
117
|
+
Then I should get a value of 1000
|
|
118
|
+
|