riddle 2.1.0 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (176) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +8 -5
  3. data/Gemfile +10 -0
  4. data/HISTORY +4 -0
  5. data/README.markdown +1 -1
  6. data/lib/riddle.rb +1 -0
  7. data/lib/riddle/0.9.9/configuration/searchd.rb +1 -1
  8. data/lib/riddle/client.rb +4 -1
  9. data/lib/riddle/client/message.rb +15 -14
  10. data/lib/riddle/configuration/parser.rb +1 -0
  11. data/lib/riddle/configuration/section.rb +9 -9
  12. data/lib/riddle/configuration/source.rb +5 -5
  13. data/lib/riddle/query/select.rb +3 -2
  14. data/riddle.gemspec +2 -4
  15. metadata +4 -329
  16. data/spec/fixtures/.gitignore +0 -2
  17. data/spec/fixtures/data/0.9.9/anchor.bin +0 -0
  18. data/spec/fixtures/data/0.9.9/any.bin +0 -0
  19. data/spec/fixtures/data/0.9.9/boolean.bin +0 -0
  20. data/spec/fixtures/data/0.9.9/comment.bin +0 -0
  21. data/spec/fixtures/data/0.9.9/distinct.bin +0 -0
  22. data/spec/fixtures/data/0.9.9/field_weights.bin +0 -0
  23. data/spec/fixtures/data/0.9.9/filter.bin +0 -0
  24. data/spec/fixtures/data/0.9.9/filter_array.bin +0 -0
  25. data/spec/fixtures/data/0.9.9/filter_array_exclude.bin +0 -0
  26. data/spec/fixtures/data/0.9.9/filter_boolean.bin +0 -0
  27. data/spec/fixtures/data/0.9.9/filter_floats.bin +0 -0
  28. data/spec/fixtures/data/0.9.9/filter_floats_exclude.bin +0 -0
  29. data/spec/fixtures/data/0.9.9/filter_range.bin +0 -0
  30. data/spec/fixtures/data/0.9.9/filter_range_exclude.bin +0 -0
  31. data/spec/fixtures/data/0.9.9/group.bin +0 -0
  32. data/spec/fixtures/data/0.9.9/index.bin +0 -0
  33. data/spec/fixtures/data/0.9.9/index_weights.bin +0 -0
  34. data/spec/fixtures/data/0.9.9/keywords_with_hits.bin +0 -0
  35. data/spec/fixtures/data/0.9.9/keywords_without_hits.bin +0 -0
  36. data/spec/fixtures/data/0.9.9/overrides.bin +0 -0
  37. data/spec/fixtures/data/0.9.9/phrase.bin +0 -0
  38. data/spec/fixtures/data/0.9.9/rank_mode.bin +0 -0
  39. data/spec/fixtures/data/0.9.9/select.bin +0 -0
  40. data/spec/fixtures/data/0.9.9/simple.bin +0 -0
  41. data/spec/fixtures/data/0.9.9/sort.bin +0 -0
  42. data/spec/fixtures/data/0.9.9/update_simple.bin +0 -0
  43. data/spec/fixtures/data/0.9.9/weights.bin +0 -0
  44. data/spec/fixtures/data/1.10/anchor.bin +0 -0
  45. data/spec/fixtures/data/1.10/any.bin +0 -0
  46. data/spec/fixtures/data/1.10/boolean.bin +0 -0
  47. data/spec/fixtures/data/1.10/comment.bin +0 -0
  48. data/spec/fixtures/data/1.10/distinct.bin +0 -0
  49. data/spec/fixtures/data/1.10/field_weights.bin +0 -0
  50. data/spec/fixtures/data/1.10/filter.bin +0 -0
  51. data/spec/fixtures/data/1.10/filter_array.bin +0 -0
  52. data/spec/fixtures/data/1.10/filter_array_exclude.bin +0 -0
  53. data/spec/fixtures/data/1.10/filter_boolean.bin +0 -0
  54. data/spec/fixtures/data/1.10/filter_floats.bin +0 -0
  55. data/spec/fixtures/data/1.10/filter_floats_exclude.bin +0 -0
  56. data/spec/fixtures/data/1.10/filter_range.bin +0 -0
  57. data/spec/fixtures/data/1.10/filter_range_exclude.bin +0 -0
  58. data/spec/fixtures/data/1.10/group.bin +0 -0
  59. data/spec/fixtures/data/1.10/index.bin +0 -0
  60. data/spec/fixtures/data/1.10/index_weights.bin +0 -0
  61. data/spec/fixtures/data/1.10/keywords_with_hits.bin +0 -0
  62. data/spec/fixtures/data/1.10/keywords_without_hits.bin +0 -0
  63. data/spec/fixtures/data/1.10/overrides.bin +0 -0
  64. data/spec/fixtures/data/1.10/phrase.bin +0 -0
  65. data/spec/fixtures/data/1.10/rank_mode.bin +0 -0
  66. data/spec/fixtures/data/1.10/select.bin +0 -0
  67. data/spec/fixtures/data/1.10/simple.bin +0 -0
  68. data/spec/fixtures/data/1.10/sort.bin +0 -0
  69. data/spec/fixtures/data/1.10/update_simple.bin +0 -0
  70. data/spec/fixtures/data/1.10/weights.bin +0 -0
  71. data/spec/fixtures/data/2.0.1/anchor.bin +0 -0
  72. data/spec/fixtures/data/2.0.1/any.bin +0 -0
  73. data/spec/fixtures/data/2.0.1/boolean.bin +0 -0
  74. data/spec/fixtures/data/2.0.1/comment.bin +0 -0
  75. data/spec/fixtures/data/2.0.1/distinct.bin +0 -0
  76. data/spec/fixtures/data/2.0.1/field_weights.bin +0 -0
  77. data/spec/fixtures/data/2.0.1/filter.bin +0 -0
  78. data/spec/fixtures/data/2.0.1/filter_array.bin +0 -0
  79. data/spec/fixtures/data/2.0.1/filter_array_exclude.bin +0 -0
  80. data/spec/fixtures/data/2.0.1/filter_boolean.bin +0 -0
  81. data/spec/fixtures/data/2.0.1/filter_floats.bin +0 -0
  82. data/spec/fixtures/data/2.0.1/filter_floats_exclude.bin +0 -0
  83. data/spec/fixtures/data/2.0.1/filter_range.bin +0 -0
  84. data/spec/fixtures/data/2.0.1/filter_range_exclude.bin +0 -0
  85. data/spec/fixtures/data/2.0.1/group.bin +0 -0
  86. data/spec/fixtures/data/2.0.1/index.bin +0 -0
  87. data/spec/fixtures/data/2.0.1/index_weights.bin +0 -0
  88. data/spec/fixtures/data/2.0.1/keywords_with_hits.bin +0 -0
  89. data/spec/fixtures/data/2.0.1/keywords_without_hits.bin +0 -0
  90. data/spec/fixtures/data/2.0.1/overrides.bin +0 -0
  91. data/spec/fixtures/data/2.0.1/phrase.bin +0 -0
  92. data/spec/fixtures/data/2.0.1/rank_mode.bin +0 -0
  93. data/spec/fixtures/data/2.0.1/select.bin +0 -0
  94. data/spec/fixtures/data/2.0.1/simple.bin +0 -0
  95. data/spec/fixtures/data/2.0.1/sort.bin +0 -0
  96. data/spec/fixtures/data/2.0.1/update_simple.bin +0 -0
  97. data/spec/fixtures/data/2.0.1/weights.bin +0 -0
  98. data/spec/fixtures/data/2.1.0/anchor.bin +0 -0
  99. data/spec/fixtures/data/2.1.0/any.bin +0 -0
  100. data/spec/fixtures/data/2.1.0/boolean.bin +0 -0
  101. data/spec/fixtures/data/2.1.0/comment.bin +0 -0
  102. data/spec/fixtures/data/2.1.0/distinct.bin +0 -0
  103. data/spec/fixtures/data/2.1.0/field_weights.bin +0 -0
  104. data/spec/fixtures/data/2.1.0/filter.bin +0 -0
  105. data/spec/fixtures/data/2.1.0/filter_array.bin +0 -0
  106. data/spec/fixtures/data/2.1.0/filter_array_exclude.bin +0 -0
  107. data/spec/fixtures/data/2.1.0/filter_boolean.bin +0 -0
  108. data/spec/fixtures/data/2.1.0/filter_floats.bin +0 -0
  109. data/spec/fixtures/data/2.1.0/filter_floats_exclude.bin +0 -0
  110. data/spec/fixtures/data/2.1.0/filter_range.bin +0 -0
  111. data/spec/fixtures/data/2.1.0/filter_range_exclude.bin +0 -0
  112. data/spec/fixtures/data/2.1.0/group.bin +0 -0
  113. data/spec/fixtures/data/2.1.0/index.bin +0 -0
  114. data/spec/fixtures/data/2.1.0/index_weights.bin +0 -0
  115. data/spec/fixtures/data/2.1.0/keywords_with_hits.bin +0 -0
  116. data/spec/fixtures/data/2.1.0/keywords_without_hits.bin +0 -0
  117. data/spec/fixtures/data/2.1.0/overrides.bin +0 -0
  118. data/spec/fixtures/data/2.1.0/phrase.bin +0 -0
  119. data/spec/fixtures/data/2.1.0/rank_mode.bin +0 -0
  120. data/spec/fixtures/data/2.1.0/select.bin +0 -0
  121. data/spec/fixtures/data/2.1.0/simple.bin +0 -0
  122. data/spec/fixtures/data/2.1.0/sort.bin +0 -0
  123. data/spec/fixtures/data/2.1.0/update_simple.bin +0 -0
  124. data/spec/fixtures/data/2.1.0/weights.bin +0 -0
  125. data/spec/fixtures/data_generator.0.9.8.php +0 -208
  126. data/spec/fixtures/data_generator.0.9.9.php +0 -5
  127. data/spec/fixtures/data_generator.1.10.php +0 -5
  128. data/spec/fixtures/data_generator.2.0.1.php +0 -5
  129. data/spec/fixtures/data_generator.2.1.0.php +0 -5
  130. data/spec/fixtures/data_generator.php +0 -223
  131. data/spec/fixtures/sphinxapi.0.9.8.php +0 -1228
  132. data/spec/fixtures/sphinxapi.0.9.9.php +0 -1646
  133. data/spec/fixtures/sphinxapi.1.10.php +0 -1728
  134. data/spec/fixtures/sphinxapi.2.0.1.php +0 -1731
  135. data/spec/fixtures/sphinxapi.2.1.0.php +0 -1752
  136. data/spec/fixtures/sql/conf.example.yml +0 -3
  137. data/spec/fixtures/sql/data.sql +0 -25000
  138. data/spec/fixtures/sql/data.tsv +0 -25000
  139. data/spec/fixtures/sql/structure.sql +0 -16
  140. data/spec/functional/connection_spec.rb +0 -64
  141. data/spec/functional/escaping_spec.rb +0 -49
  142. data/spec/functional/excerpt_spec.rb +0 -139
  143. data/spec/functional/keywords_spec.rb +0 -40
  144. data/spec/functional/persistance_spec.rb +0 -17
  145. data/spec/functional/search_spec.rb +0 -67
  146. data/spec/functional/status_spec.rb +0 -21
  147. data/spec/functional/update_spec.rb +0 -41
  148. data/spec/riddle/auto_version_spec.rb +0 -95
  149. data/spec/riddle/client_spec.rb +0 -11
  150. data/spec/riddle/configuration_spec.rb +0 -28
  151. data/spec/riddle/controller_spec.rb +0 -39
  152. data/spec/riddle/query/delete_spec.rb +0 -18
  153. data/spec/riddle/query/insert_spec.rb +0 -25
  154. data/spec/riddle/query/select_spec.rb +0 -226
  155. data/spec/riddle/query_spec.rb +0 -97
  156. data/spec/riddle_spec.rb +0 -27
  157. data/spec/spec_helper.rb +0 -34
  158. data/spec/support/binary_fixtures.rb +0 -18
  159. data/spec/support/sphinx.rb +0 -137
  160. data/spec/unit/client_spec.rb +0 -290
  161. data/spec/unit/configuration/common_spec.rb +0 -60
  162. data/spec/unit/configuration/distributed_index_spec.rb +0 -58
  163. data/spec/unit/configuration/index_spec.rb +0 -124
  164. data/spec/unit/configuration/indexer_spec.rb +0 -73
  165. data/spec/unit/configuration/realtime_index_spec.rb +0 -65
  166. data/spec/unit/configuration/searchd_spec.rb +0 -228
  167. data/spec/unit/configuration/source_spec.rb +0 -5
  168. data/spec/unit/configuration/sql_source_spec.rb +0 -137
  169. data/spec/unit/configuration/template_index_spec.rb +0 -91
  170. data/spec/unit/configuration/tsv_source_spec.rb +0 -53
  171. data/spec/unit/configuration/xml_source_spec.rb +0 -51
  172. data/spec/unit/configuration_spec.rb +0 -25
  173. data/spec/unit/filter_spec.rb +0 -38
  174. data/spec/unit/message_spec.rb +0 -94
  175. data/spec/unit/response_spec.rb +0 -64
  176. data/spec/unit/riddle_spec.rb +0 -17
@@ -1,2 +0,0 @@
1
- sql/conf.yml
2
- sphinx
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
- ?>