riddle 2.1.0 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +8 -5
- data/Gemfile +10 -0
- data/HISTORY +4 -0
- data/README.markdown +1 -1
- data/lib/riddle.rb +1 -0
- data/lib/riddle/0.9.9/configuration/searchd.rb +1 -1
- data/lib/riddle/client.rb +4 -1
- data/lib/riddle/client/message.rb +15 -14
- data/lib/riddle/configuration/parser.rb +1 -0
- data/lib/riddle/configuration/section.rb +9 -9
- data/lib/riddle/configuration/source.rb +5 -5
- data/lib/riddle/query/select.rb +3 -2
- data/riddle.gemspec +2 -4
- metadata +4 -329
- data/spec/fixtures/.gitignore +0 -2
- data/spec/fixtures/data/0.9.9/anchor.bin +0 -0
- data/spec/fixtures/data/0.9.9/any.bin +0 -0
- data/spec/fixtures/data/0.9.9/boolean.bin +0 -0
- data/spec/fixtures/data/0.9.9/comment.bin +0 -0
- data/spec/fixtures/data/0.9.9/distinct.bin +0 -0
- data/spec/fixtures/data/0.9.9/field_weights.bin +0 -0
- data/spec/fixtures/data/0.9.9/filter.bin +0 -0
- data/spec/fixtures/data/0.9.9/filter_array.bin +0 -0
- data/spec/fixtures/data/0.9.9/filter_array_exclude.bin +0 -0
- data/spec/fixtures/data/0.9.9/filter_boolean.bin +0 -0
- data/spec/fixtures/data/0.9.9/filter_floats.bin +0 -0
- data/spec/fixtures/data/0.9.9/filter_floats_exclude.bin +0 -0
- data/spec/fixtures/data/0.9.9/filter_range.bin +0 -0
- data/spec/fixtures/data/0.9.9/filter_range_exclude.bin +0 -0
- data/spec/fixtures/data/0.9.9/group.bin +0 -0
- data/spec/fixtures/data/0.9.9/index.bin +0 -0
- data/spec/fixtures/data/0.9.9/index_weights.bin +0 -0
- data/spec/fixtures/data/0.9.9/keywords_with_hits.bin +0 -0
- data/spec/fixtures/data/0.9.9/keywords_without_hits.bin +0 -0
- data/spec/fixtures/data/0.9.9/overrides.bin +0 -0
- data/spec/fixtures/data/0.9.9/phrase.bin +0 -0
- data/spec/fixtures/data/0.9.9/rank_mode.bin +0 -0
- data/spec/fixtures/data/0.9.9/select.bin +0 -0
- data/spec/fixtures/data/0.9.9/simple.bin +0 -0
- data/spec/fixtures/data/0.9.9/sort.bin +0 -0
- data/spec/fixtures/data/0.9.9/update_simple.bin +0 -0
- data/spec/fixtures/data/0.9.9/weights.bin +0 -0
- data/spec/fixtures/data/1.10/anchor.bin +0 -0
- data/spec/fixtures/data/1.10/any.bin +0 -0
- data/spec/fixtures/data/1.10/boolean.bin +0 -0
- data/spec/fixtures/data/1.10/comment.bin +0 -0
- data/spec/fixtures/data/1.10/distinct.bin +0 -0
- data/spec/fixtures/data/1.10/field_weights.bin +0 -0
- data/spec/fixtures/data/1.10/filter.bin +0 -0
- data/spec/fixtures/data/1.10/filter_array.bin +0 -0
- data/spec/fixtures/data/1.10/filter_array_exclude.bin +0 -0
- data/spec/fixtures/data/1.10/filter_boolean.bin +0 -0
- data/spec/fixtures/data/1.10/filter_floats.bin +0 -0
- data/spec/fixtures/data/1.10/filter_floats_exclude.bin +0 -0
- data/spec/fixtures/data/1.10/filter_range.bin +0 -0
- data/spec/fixtures/data/1.10/filter_range_exclude.bin +0 -0
- data/spec/fixtures/data/1.10/group.bin +0 -0
- data/spec/fixtures/data/1.10/index.bin +0 -0
- data/spec/fixtures/data/1.10/index_weights.bin +0 -0
- data/spec/fixtures/data/1.10/keywords_with_hits.bin +0 -0
- data/spec/fixtures/data/1.10/keywords_without_hits.bin +0 -0
- data/spec/fixtures/data/1.10/overrides.bin +0 -0
- data/spec/fixtures/data/1.10/phrase.bin +0 -0
- data/spec/fixtures/data/1.10/rank_mode.bin +0 -0
- data/spec/fixtures/data/1.10/select.bin +0 -0
- data/spec/fixtures/data/1.10/simple.bin +0 -0
- data/spec/fixtures/data/1.10/sort.bin +0 -0
- data/spec/fixtures/data/1.10/update_simple.bin +0 -0
- data/spec/fixtures/data/1.10/weights.bin +0 -0
- data/spec/fixtures/data/2.0.1/anchor.bin +0 -0
- data/spec/fixtures/data/2.0.1/any.bin +0 -0
- data/spec/fixtures/data/2.0.1/boolean.bin +0 -0
- data/spec/fixtures/data/2.0.1/comment.bin +0 -0
- data/spec/fixtures/data/2.0.1/distinct.bin +0 -0
- data/spec/fixtures/data/2.0.1/field_weights.bin +0 -0
- data/spec/fixtures/data/2.0.1/filter.bin +0 -0
- data/spec/fixtures/data/2.0.1/filter_array.bin +0 -0
- data/spec/fixtures/data/2.0.1/filter_array_exclude.bin +0 -0
- data/spec/fixtures/data/2.0.1/filter_boolean.bin +0 -0
- data/spec/fixtures/data/2.0.1/filter_floats.bin +0 -0
- data/spec/fixtures/data/2.0.1/filter_floats_exclude.bin +0 -0
- data/spec/fixtures/data/2.0.1/filter_range.bin +0 -0
- data/spec/fixtures/data/2.0.1/filter_range_exclude.bin +0 -0
- data/spec/fixtures/data/2.0.1/group.bin +0 -0
- data/spec/fixtures/data/2.0.1/index.bin +0 -0
- data/spec/fixtures/data/2.0.1/index_weights.bin +0 -0
- data/spec/fixtures/data/2.0.1/keywords_with_hits.bin +0 -0
- data/spec/fixtures/data/2.0.1/keywords_without_hits.bin +0 -0
- data/spec/fixtures/data/2.0.1/overrides.bin +0 -0
- data/spec/fixtures/data/2.0.1/phrase.bin +0 -0
- data/spec/fixtures/data/2.0.1/rank_mode.bin +0 -0
- data/spec/fixtures/data/2.0.1/select.bin +0 -0
- data/spec/fixtures/data/2.0.1/simple.bin +0 -0
- data/spec/fixtures/data/2.0.1/sort.bin +0 -0
- data/spec/fixtures/data/2.0.1/update_simple.bin +0 -0
- data/spec/fixtures/data/2.0.1/weights.bin +0 -0
- data/spec/fixtures/data/2.1.0/anchor.bin +0 -0
- data/spec/fixtures/data/2.1.0/any.bin +0 -0
- data/spec/fixtures/data/2.1.0/boolean.bin +0 -0
- data/spec/fixtures/data/2.1.0/comment.bin +0 -0
- data/spec/fixtures/data/2.1.0/distinct.bin +0 -0
- data/spec/fixtures/data/2.1.0/field_weights.bin +0 -0
- data/spec/fixtures/data/2.1.0/filter.bin +0 -0
- data/spec/fixtures/data/2.1.0/filter_array.bin +0 -0
- data/spec/fixtures/data/2.1.0/filter_array_exclude.bin +0 -0
- data/spec/fixtures/data/2.1.0/filter_boolean.bin +0 -0
- data/spec/fixtures/data/2.1.0/filter_floats.bin +0 -0
- data/spec/fixtures/data/2.1.0/filter_floats_exclude.bin +0 -0
- data/spec/fixtures/data/2.1.0/filter_range.bin +0 -0
- data/spec/fixtures/data/2.1.0/filter_range_exclude.bin +0 -0
- data/spec/fixtures/data/2.1.0/group.bin +0 -0
- data/spec/fixtures/data/2.1.0/index.bin +0 -0
- data/spec/fixtures/data/2.1.0/index_weights.bin +0 -0
- data/spec/fixtures/data/2.1.0/keywords_with_hits.bin +0 -0
- data/spec/fixtures/data/2.1.0/keywords_without_hits.bin +0 -0
- data/spec/fixtures/data/2.1.0/overrides.bin +0 -0
- data/spec/fixtures/data/2.1.0/phrase.bin +0 -0
- data/spec/fixtures/data/2.1.0/rank_mode.bin +0 -0
- data/spec/fixtures/data/2.1.0/select.bin +0 -0
- data/spec/fixtures/data/2.1.0/simple.bin +0 -0
- data/spec/fixtures/data/2.1.0/sort.bin +0 -0
- data/spec/fixtures/data/2.1.0/update_simple.bin +0 -0
- data/spec/fixtures/data/2.1.0/weights.bin +0 -0
- data/spec/fixtures/data_generator.0.9.8.php +0 -208
- data/spec/fixtures/data_generator.0.9.9.php +0 -5
- data/spec/fixtures/data_generator.1.10.php +0 -5
- data/spec/fixtures/data_generator.2.0.1.php +0 -5
- data/spec/fixtures/data_generator.2.1.0.php +0 -5
- data/spec/fixtures/data_generator.php +0 -223
- data/spec/fixtures/sphinxapi.0.9.8.php +0 -1228
- data/spec/fixtures/sphinxapi.0.9.9.php +0 -1646
- data/spec/fixtures/sphinxapi.1.10.php +0 -1728
- data/spec/fixtures/sphinxapi.2.0.1.php +0 -1731
- data/spec/fixtures/sphinxapi.2.1.0.php +0 -1752
- data/spec/fixtures/sql/conf.example.yml +0 -3
- data/spec/fixtures/sql/data.sql +0 -25000
- data/spec/fixtures/sql/data.tsv +0 -25000
- data/spec/fixtures/sql/structure.sql +0 -16
- data/spec/functional/connection_spec.rb +0 -64
- data/spec/functional/escaping_spec.rb +0 -49
- data/spec/functional/excerpt_spec.rb +0 -139
- data/spec/functional/keywords_spec.rb +0 -40
- data/spec/functional/persistance_spec.rb +0 -17
- data/spec/functional/search_spec.rb +0 -67
- data/spec/functional/status_spec.rb +0 -21
- data/spec/functional/update_spec.rb +0 -41
- data/spec/riddle/auto_version_spec.rb +0 -95
- data/spec/riddle/client_spec.rb +0 -11
- data/spec/riddle/configuration_spec.rb +0 -28
- data/spec/riddle/controller_spec.rb +0 -39
- data/spec/riddle/query/delete_spec.rb +0 -18
- data/spec/riddle/query/insert_spec.rb +0 -25
- data/spec/riddle/query/select_spec.rb +0 -226
- data/spec/riddle/query_spec.rb +0 -97
- data/spec/riddle_spec.rb +0 -27
- data/spec/spec_helper.rb +0 -34
- data/spec/support/binary_fixtures.rb +0 -18
- data/spec/support/sphinx.rb +0 -137
- data/spec/unit/client_spec.rb +0 -290
- data/spec/unit/configuration/common_spec.rb +0 -60
- data/spec/unit/configuration/distributed_index_spec.rb +0 -58
- data/spec/unit/configuration/index_spec.rb +0 -124
- data/spec/unit/configuration/indexer_spec.rb +0 -73
- data/spec/unit/configuration/realtime_index_spec.rb +0 -65
- data/spec/unit/configuration/searchd_spec.rb +0 -228
- data/spec/unit/configuration/source_spec.rb +0 -5
- data/spec/unit/configuration/sql_source_spec.rb +0 -137
- data/spec/unit/configuration/template_index_spec.rb +0 -91
- data/spec/unit/configuration/tsv_source_spec.rb +0 -53
- data/spec/unit/configuration/xml_source_spec.rb +0 -51
- data/spec/unit/configuration_spec.rb +0 -25
- data/spec/unit/filter_spec.rb +0 -38
- data/spec/unit/message_spec.rb +0 -94
- data/spec/unit/response_spec.rb +0 -64
- data/spec/unit/riddle_spec.rb +0 -17
data/spec/fixtures/.gitignore
DELETED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -1,208 +0,0 @@
|
|
1
|
-
<?php
|
2
|
-
include 'sphinxapi.0.9.8.php';
|
3
|
-
|
4
|
-
$client = new SphinxClient();
|
5
|
-
$client->SetServer("localhost", 3312);
|
6
|
-
|
7
|
-
// simple
|
8
|
-
$file = fopen("spec/fixtures/data/simple.bin", "w");
|
9
|
-
fwrite($file, $client->_reqs[$client->AddQuery("test ")]);
|
10
|
-
fclose($file);
|
11
|
-
|
12
|
-
// index
|
13
|
-
$file = fopen("spec/fixtures/data/index.bin", "w");
|
14
|
-
fwrite($file, $client->_reqs[$client->AddQuery("test ", "edition")]);
|
15
|
-
fclose($file);
|
16
|
-
|
17
|
-
// any
|
18
|
-
$client->SetMatchMode(SPH_MATCH_ANY);
|
19
|
-
|
20
|
-
$file = fopen("spec/fixtures/data/any.bin", "w");
|
21
|
-
fwrite($file, $client->_reqs[$client->AddQuery("test this ")]);
|
22
|
-
fclose($file);
|
23
|
-
|
24
|
-
$client->SetMatchMode(SPH_MATCH_ALL);
|
25
|
-
|
26
|
-
// sort
|
27
|
-
$client->SetSortMode(SPH_SORT_EXTENDED, "id");
|
28
|
-
|
29
|
-
$file = fopen("spec/fixtures/data/sort.bin", "w");
|
30
|
-
fwrite($file, $client->_reqs[$client->AddQuery("testing ")]);
|
31
|
-
fclose($file);
|
32
|
-
|
33
|
-
$client->SetSortMode(SPH_SORT_RELEVANCE, "");
|
34
|
-
|
35
|
-
// boolean
|
36
|
-
$client->SetMatchMode(SPH_MATCH_BOOLEAN);
|
37
|
-
|
38
|
-
$file = fopen("spec/fixtures/data/boolean.bin", "w");
|
39
|
-
fwrite($file, $client->_reqs[$client->AddQuery("test ")]);
|
40
|
-
fclose($file);
|
41
|
-
|
42
|
-
$client->SetMatchMode(SPH_MATCH_ALL);
|
43
|
-
|
44
|
-
// phrase
|
45
|
-
$client->SetMatchMode(SPH_MATCH_PHRASE);
|
46
|
-
|
47
|
-
$file = fopen("spec/fixtures/data/phrase.bin", "w");
|
48
|
-
fwrite($file, $client->_reqs[$client->AddQuery("testing this ")]);
|
49
|
-
fclose($file);
|
50
|
-
|
51
|
-
$client->SetMatchMode(SPH_MATCH_ALL);
|
52
|
-
|
53
|
-
// filter
|
54
|
-
$client->SetFilter("id", array(10, 100, 1000));
|
55
|
-
|
56
|
-
$file = fopen("spec/fixtures/data/filter.bin", "w");
|
57
|
-
fwrite($file, $client->_reqs[$client->AddQuery("test ")]);
|
58
|
-
fclose($file);
|
59
|
-
|
60
|
-
$client->ResetFilters();
|
61
|
-
|
62
|
-
// group
|
63
|
-
$client->SetGroupBy("id", SPH_GROUPBY_ATTR, "id");
|
64
|
-
|
65
|
-
$file = fopen("spec/fixtures/data/group.bin", "w");
|
66
|
-
fwrite($file, $client->_reqs[$client->AddQuery("test ")]);
|
67
|
-
fclose($file);
|
68
|
-
|
69
|
-
$client->ResetGroupBy();
|
70
|
-
|
71
|
-
// distinct
|
72
|
-
$client->SetGroupDistinct("id");
|
73
|
-
|
74
|
-
$file = fopen("spec/fixtures/data/distinct.bin", "w");
|
75
|
-
fwrite($file, $client->_reqs[$client->AddQuery("test ")]);
|
76
|
-
fclose($file);
|
77
|
-
|
78
|
-
$client->ResetGroupBy();
|
79
|
-
|
80
|
-
// weights
|
81
|
-
$client->SetWeights(array(100, 1));
|
82
|
-
|
83
|
-
$file = fopen("spec/fixtures/data/weights.bin", "w");
|
84
|
-
fwrite($file, $client->_reqs[$client->AddQuery("test ")]);
|
85
|
-
fclose($file);
|
86
|
-
|
87
|
-
$client->SetWeights(array());
|
88
|
-
|
89
|
-
// anchor
|
90
|
-
$client->SetGeoAnchor("latitude", "longitude", 10.0, 95.0);
|
91
|
-
|
92
|
-
$file = fopen("spec/fixtures/data/anchor.bin", "w");
|
93
|
-
fwrite($file, $client->_reqs[$client->AddQuery("test ")]);
|
94
|
-
fclose($file);
|
95
|
-
|
96
|
-
$client->ResetFilters();
|
97
|
-
|
98
|
-
// rank_mode
|
99
|
-
$client->SetRankingMode(SPH_RANK_WORDCOUNT);
|
100
|
-
|
101
|
-
$file = fopen("spec/fixtures/data/rank_mode.bin", "w");
|
102
|
-
fwrite($file, $client->_reqs[$client->AddQuery("test ")]);
|
103
|
-
fclose($file);
|
104
|
-
|
105
|
-
$client->SetRankingMode(SPH_RANK_PROXIMITY_BM25);
|
106
|
-
|
107
|
-
// index_weights
|
108
|
-
$client->SetIndexWeights(array("people" => 101));
|
109
|
-
|
110
|
-
$file = fopen("spec/fixtures/data/index_weights.bin", "w");
|
111
|
-
fwrite($file, $client->_reqs[$client->AddQuery("test ")]);
|
112
|
-
fclose($file);
|
113
|
-
|
114
|
-
$client->SetIndexWeights(array());
|
115
|
-
|
116
|
-
// index_weights
|
117
|
-
$client->SetFieldWeights(array("city" => 101));
|
118
|
-
|
119
|
-
$file = fopen("spec/fixtures/data/field_weights.bin", "w");
|
120
|
-
fwrite($file, $client->_reqs[$client->AddQuery("test ")]);
|
121
|
-
fclose($file);
|
122
|
-
|
123
|
-
$client->SetFieldWeights(array());
|
124
|
-
|
125
|
-
// comment
|
126
|
-
$file = fopen("spec/fixtures/data/comment.bin", "w");
|
127
|
-
fwrite($file, $client->_reqs[$client->AddQuery("test ", "*", "commenting")]);
|
128
|
-
fclose($file);
|
129
|
-
|
130
|
-
// update_simple
|
131
|
-
$file = fopen("spec/fixtures/data/update_simple.bin", "w");
|
132
|
-
fwrite($file, $client->UpdateAttributes("people", array("birthday"), array(1 => array(191163600))));
|
133
|
-
fclose($file);
|
134
|
-
|
135
|
-
// keywords_without_hits
|
136
|
-
$file = fopen("spec/fixtures/data/keywords_without_hits.bin", "w");
|
137
|
-
fwrite($file, $client->BuildKeywords("pat", "people", false));
|
138
|
-
fclose($file);
|
139
|
-
|
140
|
-
// keywords_with_hits
|
141
|
-
$file = fopen("spec/fixtures/data/keywords_with_hits.bin", "w");
|
142
|
-
fwrite($file, $client->BuildKeywords("pat", "people", true));
|
143
|
-
fclose($file);
|
144
|
-
|
145
|
-
// filter_array
|
146
|
-
$client->SetFilter("field", array(1, 2, 3));
|
147
|
-
|
148
|
-
$file = fopen("spec/fixtures/data/filter_array.bin", "w");
|
149
|
-
fwrite($file, $client->FilterOutput());
|
150
|
-
fclose($file);
|
151
|
-
|
152
|
-
$client->ResetFilters();
|
153
|
-
|
154
|
-
// filter_array_exclude
|
155
|
-
$client->SetFilter("field", array(1, 2, 3), true);
|
156
|
-
|
157
|
-
$file = fopen("spec/fixtures/data/filter_array_exclude.bin", "w");
|
158
|
-
fwrite($file, $client->FilterOutput());
|
159
|
-
fclose($file);
|
160
|
-
|
161
|
-
$client->ResetFilters();
|
162
|
-
|
163
|
-
// filter_range
|
164
|
-
$client->SetFilterRange("field", 1, 3);
|
165
|
-
|
166
|
-
$file = fopen("spec/fixtures/data/filter_range.bin", "w");
|
167
|
-
fwrite($file, $client->FilterOutput());
|
168
|
-
fclose($file);
|
169
|
-
|
170
|
-
$client->ResetFilters();
|
171
|
-
|
172
|
-
// filter_range_exclude
|
173
|
-
$client->SetFilterRange("field", 1, 3, true);
|
174
|
-
|
175
|
-
$file = fopen("spec/fixtures/data/filter_range_exclude.bin", "w");
|
176
|
-
fwrite($file, $client->FilterOutput());
|
177
|
-
fclose($file);
|
178
|
-
|
179
|
-
$client->ResetFilters();
|
180
|
-
|
181
|
-
// filter_floats
|
182
|
-
$client->SetFilterFloatRange("field", 5.4, 13.5);
|
183
|
-
|
184
|
-
$file = fopen("spec/fixtures/data/filter_floats.bin", "w");
|
185
|
-
fwrite($file, $client->FilterOutput());
|
186
|
-
fclose($file);
|
187
|
-
|
188
|
-
$client->ResetFilters();
|
189
|
-
|
190
|
-
// filter_floats_exclude
|
191
|
-
$client->SetFilterFloatRange("field", 5.4, 13.5, true);
|
192
|
-
|
193
|
-
$file = fopen("spec/fixtures/data/filter_floats_exclude.bin", "w");
|
194
|
-
fwrite($file, $client->FilterOutput());
|
195
|
-
fclose($file);
|
196
|
-
|
197
|
-
$client->ResetFilters();
|
198
|
-
|
199
|
-
// filter_boolean
|
200
|
-
$client->SetFilter("field", array(0, 1));
|
201
|
-
|
202
|
-
$file = fopen("spec/fixtures/data/filter_boolean.bin", "w");
|
203
|
-
fwrite($file, $client->FilterOutput());
|
204
|
-
fclose($file);
|
205
|
-
|
206
|
-
$client->ResetFilters();
|
207
|
-
|
208
|
-
?>
|