thinking-sphinx 3.4.2 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (333) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +20 -18
  3. data/Appraisals +28 -16
  4. data/CHANGELOG.markdown +538 -0
  5. data/Gemfile +9 -11
  6. data/README.textile +23 -31
  7. data/Rakefile +2 -0
  8. data/bin/console +2 -1
  9. data/bin/loadsphinx +29 -2
  10. data/lib/thinking-sphinx.rb +2 -0
  11. data/lib/thinking/sphinx.rb +2 -0
  12. data/lib/thinking_sphinx.rb +24 -13
  13. data/lib/thinking_sphinx/active_record.rb +10 -1
  14. data/lib/thinking_sphinx/active_record/association.rb +2 -0
  15. data/lib/thinking_sphinx/active_record/association_proxy.rb +2 -0
  16. data/lib/thinking_sphinx/active_record/association_proxy/attribute_finder.rb +2 -0
  17. data/lib/thinking_sphinx/active_record/association_proxy/attribute_matcher.rb +2 -0
  18. data/lib/thinking_sphinx/active_record/attribute.rb +2 -0
  19. data/lib/thinking_sphinx/active_record/attribute/sphinx_presenter.rb +2 -0
  20. data/lib/thinking_sphinx/active_record/attribute/type.rb +2 -0
  21. data/lib/thinking_sphinx/active_record/attribute/values.rb +2 -0
  22. data/lib/thinking_sphinx/active_record/base.rb +2 -0
  23. data/lib/thinking_sphinx/active_record/callbacks/delete_callbacks.rb +2 -0
  24. data/lib/thinking_sphinx/active_record/callbacks/delta_callbacks.rb +2 -0
  25. data/lib/thinking_sphinx/active_record/callbacks/update_callbacks.rb +2 -0
  26. data/lib/thinking_sphinx/active_record/column.rb +2 -0
  27. data/lib/thinking_sphinx/active_record/column_sql_presenter.rb +2 -0
  28. data/lib/thinking_sphinx/active_record/database_adapters.rb +2 -0
  29. data/lib/thinking_sphinx/active_record/database_adapters/abstract_adapter.rb +2 -0
  30. data/lib/thinking_sphinx/active_record/database_adapters/mysql_adapter.rb +2 -0
  31. data/lib/thinking_sphinx/active_record/database_adapters/postgresql_adapter.rb +2 -0
  32. data/lib/thinking_sphinx/active_record/depolymorph/association_reflection.rb +32 -0
  33. data/lib/thinking_sphinx/active_record/depolymorph/base_reflection.rb +32 -0
  34. data/lib/thinking_sphinx/active_record/depolymorph/conditions_reflection.rb +40 -0
  35. data/lib/thinking_sphinx/active_record/depolymorph/overridden_reflection.rb +35 -0
  36. data/lib/thinking_sphinx/active_record/depolymorph/scoped_reflection.rb +26 -0
  37. data/lib/thinking_sphinx/active_record/field.rb +2 -0
  38. data/lib/thinking_sphinx/active_record/filter_reflection.rb +13 -71
  39. data/lib/thinking_sphinx/active_record/index.rb +2 -0
  40. data/lib/thinking_sphinx/active_record/interpreter.rb +2 -0
  41. data/lib/thinking_sphinx/active_record/join_association.rb +2 -0
  42. data/lib/thinking_sphinx/active_record/log_subscriber.rb +2 -0
  43. data/lib/thinking_sphinx/active_record/polymorpher.rb +2 -0
  44. data/lib/thinking_sphinx/active_record/property.rb +2 -0
  45. data/lib/thinking_sphinx/active_record/property_query.rb +2 -0
  46. data/lib/thinking_sphinx/active_record/property_sql_presenter.rb +2 -0
  47. data/lib/thinking_sphinx/active_record/simple_many_query.rb +2 -0
  48. data/lib/thinking_sphinx/active_record/source_joins.rb +2 -0
  49. data/lib/thinking_sphinx/active_record/sql_builder.rb +2 -0
  50. data/lib/thinking_sphinx/active_record/sql_builder/clause_builder.rb +2 -0
  51. data/lib/thinking_sphinx/active_record/sql_builder/query.rb +2 -0
  52. data/lib/thinking_sphinx/active_record/sql_builder/statement.rb +2 -0
  53. data/lib/thinking_sphinx/active_record/sql_source.rb +15 -3
  54. data/lib/thinking_sphinx/active_record/sql_source/template.rb +2 -0
  55. data/lib/thinking_sphinx/attribute_types.rb +2 -0
  56. data/lib/thinking_sphinx/batched_search.rb +2 -0
  57. data/lib/thinking_sphinx/callbacks.rb +2 -0
  58. data/lib/thinking_sphinx/capistrano.rb +2 -0
  59. data/lib/thinking_sphinx/capistrano/v2.rb +2 -0
  60. data/lib/thinking_sphinx/capistrano/v3.rb +2 -0
  61. data/lib/thinking_sphinx/commander.rb +27 -0
  62. data/lib/thinking_sphinx/commands.rb +20 -0
  63. data/lib/thinking_sphinx/commands/base.rb +9 -1
  64. data/lib/thinking_sphinx/commands/clear_real_time.rb +22 -0
  65. data/lib/thinking_sphinx/commands/clear_sql.rb +18 -0
  66. data/lib/thinking_sphinx/commands/configure.rb +2 -0
  67. data/lib/thinking_sphinx/commands/index_real_time.rb +17 -0
  68. data/lib/thinking_sphinx/commands/index_sql.rb +25 -0
  69. data/lib/thinking_sphinx/commands/merge.rb +27 -0
  70. data/lib/thinking_sphinx/commands/merge_and_update.rb +57 -0
  71. data/lib/thinking_sphinx/commands/prepare.rb +13 -0
  72. data/lib/thinking_sphinx/commands/rotate.rb +13 -0
  73. data/lib/thinking_sphinx/commands/running.rb +13 -0
  74. data/lib/thinking_sphinx/commands/start_attached.rb +2 -0
  75. data/lib/thinking_sphinx/commands/start_detached.rb +3 -1
  76. data/lib/thinking_sphinx/commands/stop.rb +4 -2
  77. data/lib/thinking_sphinx/configuration.rb +28 -47
  78. data/lib/thinking_sphinx/configuration/consistent_ids.rb +2 -0
  79. data/lib/thinking_sphinx/configuration/defaults.rb +2 -0
  80. data/lib/thinking_sphinx/configuration/distributed_indices.rb +2 -0
  81. data/lib/thinking_sphinx/configuration/duplicate_names.rb +2 -0
  82. data/lib/thinking_sphinx/configuration/minimum_fields.rb +2 -0
  83. data/lib/thinking_sphinx/connection.rb +4 -5
  84. data/lib/thinking_sphinx/connection/client.rb +21 -0
  85. data/lib/thinking_sphinx/connection/jruby.rb +7 -2
  86. data/lib/thinking_sphinx/connection/mri.rb +2 -4
  87. data/lib/thinking_sphinx/core.rb +2 -0
  88. data/lib/thinking_sphinx/core/field.rb +2 -0
  89. data/lib/thinking_sphinx/core/index.rb +4 -1
  90. data/lib/thinking_sphinx/core/interpreter.rb +2 -0
  91. data/lib/thinking_sphinx/core/property.rb +2 -0
  92. data/lib/thinking_sphinx/core/settings.rb +2 -0
  93. data/lib/thinking_sphinx/deletion.rb +2 -0
  94. data/lib/thinking_sphinx/deltas.rb +2 -0
  95. data/lib/thinking_sphinx/deltas/default_delta.rb +2 -0
  96. data/lib/thinking_sphinx/deltas/delete_job.rb +2 -0
  97. data/lib/thinking_sphinx/deltas/index_job.rb +9 -1
  98. data/lib/thinking_sphinx/distributed.rb +2 -0
  99. data/lib/thinking_sphinx/distributed/index.rb +2 -0
  100. data/lib/thinking_sphinx/errors.rb +9 -0
  101. data/lib/thinking_sphinx/excerpter.rb +2 -0
  102. data/lib/thinking_sphinx/facet.rb +4 -3
  103. data/lib/thinking_sphinx/facet_search.rb +4 -2
  104. data/lib/thinking_sphinx/float_formatter.rb +2 -0
  105. data/lib/thinking_sphinx/frameworks.rb +2 -0
  106. data/lib/thinking_sphinx/frameworks/plain.rb +2 -0
  107. data/lib/thinking_sphinx/frameworks/rails.rb +2 -0
  108. data/lib/thinking_sphinx/guard.rb +3 -0
  109. data/lib/thinking_sphinx/guard/file.rb +2 -0
  110. data/lib/thinking_sphinx/guard/files.rb +2 -0
  111. data/lib/thinking_sphinx/guard/none.rb +7 -0
  112. data/lib/thinking_sphinx/hooks/guard_presence.rb +34 -0
  113. data/lib/thinking_sphinx/index.rb +2 -0
  114. data/lib/thinking_sphinx/index_set.rb +2 -0
  115. data/lib/thinking_sphinx/indexing_strategies/all_at_once.rb +2 -0
  116. data/lib/thinking_sphinx/indexing_strategies/one_at_a_time.rb +2 -0
  117. data/lib/thinking_sphinx/interfaces.rb +10 -0
  118. data/lib/thinking_sphinx/interfaces/base.rb +13 -0
  119. data/lib/thinking_sphinx/interfaces/daemon.rb +6 -11
  120. data/lib/thinking_sphinx/interfaces/real_time.rb +19 -14
  121. data/lib/thinking_sphinx/interfaces/sql.rb +22 -10
  122. data/lib/thinking_sphinx/logger.rb +2 -0
  123. data/lib/thinking_sphinx/masks.rb +2 -0
  124. data/lib/thinking_sphinx/masks/group_enumerators_mask.rb +6 -4
  125. data/lib/thinking_sphinx/masks/pagination_mask.rb +2 -0
  126. data/lib/thinking_sphinx/masks/scopes_mask.rb +2 -0
  127. data/lib/thinking_sphinx/masks/weight_enumerator_mask.rb +3 -1
  128. data/lib/thinking_sphinx/middlewares.rb +5 -3
  129. data/lib/thinking_sphinx/middlewares/active_record_translator.rb +2 -0
  130. data/lib/thinking_sphinx/middlewares/geographer.rb +2 -0
  131. data/lib/thinking_sphinx/middlewares/glazier.rb +2 -0
  132. data/lib/thinking_sphinx/middlewares/ids_only.rb +2 -0
  133. data/lib/thinking_sphinx/middlewares/inquirer.rb +2 -0
  134. data/lib/thinking_sphinx/middlewares/middleware.rb +2 -0
  135. data/lib/thinking_sphinx/middlewares/sphinxql.rb +4 -2
  136. data/lib/thinking_sphinx/middlewares/stale_id_checker.rb +2 -0
  137. data/lib/thinking_sphinx/middlewares/stale_id_filter.rb +2 -0
  138. data/lib/thinking_sphinx/middlewares/valid_options.rb +2 -0
  139. data/lib/thinking_sphinx/panes.rb +2 -0
  140. data/lib/thinking_sphinx/panes/attributes_pane.rb +2 -0
  141. data/lib/thinking_sphinx/panes/distance_pane.rb +2 -0
  142. data/lib/thinking_sphinx/panes/excerpts_pane.rb +2 -0
  143. data/lib/thinking_sphinx/panes/weight_pane.rb +3 -1
  144. data/lib/thinking_sphinx/query.rb +2 -0
  145. data/lib/thinking_sphinx/railtie.rb +2 -0
  146. data/lib/thinking_sphinx/rake_interface.rb +3 -1
  147. data/lib/thinking_sphinx/real_time.rb +3 -0
  148. data/lib/thinking_sphinx/real_time/attribute.rb +2 -0
  149. data/lib/thinking_sphinx/real_time/callbacks/real_time_callbacks.rb +2 -0
  150. data/lib/thinking_sphinx/real_time/field.rb +2 -0
  151. data/lib/thinking_sphinx/real_time/index.rb +2 -0
  152. data/lib/thinking_sphinx/real_time/index/template.rb +2 -0
  153. data/lib/thinking_sphinx/real_time/interpreter.rb +2 -0
  154. data/lib/thinking_sphinx/real_time/populator.rb +2 -1
  155. data/lib/thinking_sphinx/real_time/property.rb +2 -0
  156. data/lib/thinking_sphinx/real_time/transcribe_instance.rb +38 -0
  157. data/lib/thinking_sphinx/real_time/transcriber.rb +18 -27
  158. data/lib/thinking_sphinx/real_time/translator.rb +3 -1
  159. data/lib/thinking_sphinx/scopes.rb +2 -0
  160. data/lib/thinking_sphinx/search.rb +2 -0
  161. data/lib/thinking_sphinx/search/batch_inquirer.rb +2 -0
  162. data/lib/thinking_sphinx/search/context.rb +2 -0
  163. data/lib/thinking_sphinx/search/glaze.rb +2 -0
  164. data/lib/thinking_sphinx/search/merger.rb +2 -0
  165. data/lib/thinking_sphinx/search/query.rb +2 -0
  166. data/lib/thinking_sphinx/search/stale_ids_exception.rb +2 -0
  167. data/lib/thinking_sphinx/settings.rb +110 -0
  168. data/lib/thinking_sphinx/sinatra.rb +2 -0
  169. data/lib/thinking_sphinx/subscribers/populator_subscriber.rb +18 -0
  170. data/lib/thinking_sphinx/tasks.rb +13 -46
  171. data/lib/thinking_sphinx/test.rb +2 -0
  172. data/lib/thinking_sphinx/utf8.rb +2 -0
  173. data/lib/thinking_sphinx/wildcard.rb +2 -0
  174. data/lib/thinking_sphinx/with_output.rb +2 -0
  175. data/spec/acceptance/association_scoping_spec.rb +2 -0
  176. data/spec/acceptance/attribute_access_spec.rb +4 -4
  177. data/spec/acceptance/attribute_updates_spec.rb +2 -0
  178. data/spec/acceptance/batch_searching_spec.rb +2 -0
  179. data/spec/acceptance/big_integers_spec.rb +2 -0
  180. data/spec/acceptance/connection_spec.rb +2 -0
  181. data/spec/acceptance/excerpts_spec.rb +1 -0
  182. data/spec/acceptance/facets_spec.rb +2 -3
  183. data/spec/acceptance/geosearching_spec.rb +3 -1
  184. data/spec/acceptance/grouping_by_attributes_spec.rb +2 -0
  185. data/spec/acceptance/index_options_spec.rb +2 -0
  186. data/spec/acceptance/indexing_spec.rb +2 -0
  187. data/spec/acceptance/merging_spec.rb +90 -0
  188. data/spec/acceptance/paginating_search_results_spec.rb +2 -0
  189. data/spec/acceptance/real_time_updates_spec.rb +2 -0
  190. data/spec/acceptance/remove_deleted_records_spec.rb +2 -0
  191. data/spec/acceptance/search_counts_spec.rb +2 -0
  192. data/spec/acceptance/search_for_just_ids_spec.rb +2 -0
  193. data/spec/acceptance/searching_across_models_spec.rb +2 -0
  194. data/spec/acceptance/searching_across_schemas_spec.rb +2 -0
  195. data/spec/acceptance/searching_on_fields_spec.rb +2 -0
  196. data/spec/acceptance/searching_with_filters_spec.rb +2 -0
  197. data/spec/acceptance/searching_with_sti_spec.rb +2 -0
  198. data/spec/acceptance/searching_within_a_model_spec.rb +2 -0
  199. data/spec/acceptance/sorting_search_results_spec.rb +2 -0
  200. data/spec/acceptance/spec_helper.rb +2 -13
  201. data/spec/acceptance/specifying_sql_spec.rb +2 -0
  202. data/spec/acceptance/sphinx_scopes_spec.rb +2 -0
  203. data/spec/acceptance/sql_deltas_spec.rb +2 -0
  204. data/spec/acceptance/support/database_cleaner.rb +2 -0
  205. data/spec/acceptance/support/sphinx_controller.rb +16 -5
  206. data/spec/acceptance/support/sphinx_helpers.rb +11 -0
  207. data/spec/acceptance/suspended_deltas_spec.rb +2 -0
  208. data/spec/internal/app/indices/admin_person_index.rb +2 -0
  209. data/spec/internal/app/indices/album_index.rb +2 -0
  210. data/spec/internal/app/indices/animal_index.rb +2 -0
  211. data/spec/internal/app/indices/article_index.rb +2 -0
  212. data/spec/internal/app/indices/bird_index.rb +2 -0
  213. data/spec/internal/app/indices/book_index.rb +2 -0
  214. data/spec/internal/app/indices/car_index.rb +2 -0
  215. data/spec/internal/app/indices/city_index.rb +2 -0
  216. data/spec/internal/app/indices/product_index.rb +2 -0
  217. data/spec/internal/app/indices/tee_index.rb +2 -0
  218. data/spec/internal/app/indices/user_index.rb +2 -0
  219. data/spec/internal/app/models/admin/person.rb +2 -0
  220. data/spec/internal/app/models/album.rb +2 -0
  221. data/spec/internal/app/models/animal.rb +2 -0
  222. data/spec/internal/app/models/article.rb +2 -0
  223. data/spec/internal/app/models/bird.rb +2 -0
  224. data/spec/internal/app/models/book.rb +2 -0
  225. data/spec/internal/app/models/car.rb +2 -0
  226. data/spec/internal/app/models/categorisation.rb +2 -0
  227. data/spec/internal/app/models/category.rb +2 -0
  228. data/spec/internal/app/models/city.rb +2 -0
  229. data/spec/internal/app/models/colour.rb +2 -0
  230. data/spec/internal/app/models/event.rb +2 -0
  231. data/spec/internal/app/models/flightless_bird.rb +2 -0
  232. data/spec/internal/app/models/genre.rb +2 -0
  233. data/spec/internal/app/models/hardcover.rb +2 -0
  234. data/spec/internal/app/models/mammal.rb +2 -0
  235. data/spec/internal/app/models/manufacturer.rb +2 -0
  236. data/spec/internal/app/models/product.rb +2 -0
  237. data/spec/internal/app/models/tag.rb +2 -0
  238. data/spec/internal/app/models/tagging.rb +2 -0
  239. data/spec/internal/app/models/tee.rb +2 -0
  240. data/spec/internal/app/models/tweet.rb +2 -0
  241. data/spec/internal/app/models/user.rb +2 -0
  242. data/spec/internal/db/schema.rb +2 -0
  243. data/spec/spec_helper.rb +4 -1
  244. data/spec/support/json_column.rb +3 -5
  245. data/spec/support/multi_schema.rb +2 -0
  246. data/spec/support/mysql.rb +25 -0
  247. data/spec/support/sphinx_yaml_helpers.rb +2 -0
  248. data/spec/thinking_sphinx/active_record/association_spec.rb +2 -0
  249. data/spec/thinking_sphinx/active_record/attribute/type_spec.rb +2 -0
  250. data/spec/thinking_sphinx/active_record/base_spec.rb +2 -0
  251. data/spec/thinking_sphinx/active_record/callbacks/delete_callbacks_spec.rb +2 -0
  252. data/spec/thinking_sphinx/active_record/callbacks/delta_callbacks_spec.rb +2 -0
  253. data/spec/thinking_sphinx/active_record/callbacks/update_callbacks_spec.rb +2 -0
  254. data/spec/thinking_sphinx/active_record/column_spec.rb +2 -0
  255. data/spec/thinking_sphinx/active_record/column_sql_presenter_spec.rb +2 -0
  256. data/spec/thinking_sphinx/active_record/database_adapters/abstract_adapter_spec.rb +2 -0
  257. data/spec/thinking_sphinx/active_record/database_adapters/mysql_adapter_spec.rb +2 -0
  258. data/spec/thinking_sphinx/active_record/database_adapters/postgresql_adapter_spec.rb +2 -0
  259. data/spec/thinking_sphinx/active_record/database_adapters_spec.rb +2 -0
  260. data/spec/thinking_sphinx/active_record/field_spec.rb +2 -0
  261. data/spec/thinking_sphinx/active_record/filter_reflection_spec.rb +100 -79
  262. data/spec/thinking_sphinx/active_record/index_spec.rb +16 -1
  263. data/spec/thinking_sphinx/active_record/interpreter_spec.rb +2 -0
  264. data/spec/thinking_sphinx/active_record/polymorpher_spec.rb +2 -0
  265. data/spec/thinking_sphinx/active_record/property_sql_presenter_spec.rb +2 -0
  266. data/spec/thinking_sphinx/active_record/sql_builder_spec.rb +2 -0
  267. data/spec/thinking_sphinx/active_record/sql_source_spec.rb +2 -0
  268. data/spec/thinking_sphinx/attribute_types_spec.rb +2 -0
  269. data/spec/thinking_sphinx/commands/clear_real_time_spec.rb +46 -0
  270. data/spec/thinking_sphinx/commands/clear_sql_spec.rb +52 -0
  271. data/spec/thinking_sphinx/commands/configure_spec.rb +2 -0
  272. data/spec/thinking_sphinx/commands/index_real_time_spec.rb +33 -0
  273. data/spec/thinking_sphinx/commands/index_sql_spec.rb +86 -0
  274. data/spec/thinking_sphinx/commands/merge_and_update_spec.rb +106 -0
  275. data/spec/thinking_sphinx/commands/merge_spec.rb +48 -0
  276. data/spec/thinking_sphinx/commands/prepare_spec.rb +23 -0
  277. data/spec/thinking_sphinx/commands/start_detached_spec.rb +2 -0
  278. data/spec/thinking_sphinx/commands/stop_spec.rb +13 -4
  279. data/spec/thinking_sphinx/configuration/minimum_fields_spec.rb +2 -0
  280. data/spec/thinking_sphinx/configuration_spec.rb +132 -6
  281. data/spec/thinking_sphinx/connection_spec.rb +2 -0
  282. data/spec/thinking_sphinx/deletion_spec.rb +2 -0
  283. data/spec/thinking_sphinx/deltas/default_delta_spec.rb +8 -1
  284. data/spec/thinking_sphinx/deltas_spec.rb +2 -0
  285. data/spec/thinking_sphinx/errors_spec.rb +2 -0
  286. data/spec/thinking_sphinx/excerpter_spec.rb +2 -0
  287. data/spec/thinking_sphinx/facet_search_spec.rb +8 -6
  288. data/spec/thinking_sphinx/hooks/guard_presence_spec.rb +30 -0
  289. data/spec/thinking_sphinx/index_set_spec.rb +2 -0
  290. data/spec/thinking_sphinx/index_spec.rb +2 -0
  291. data/spec/thinking_sphinx/interfaces/daemon_spec.rb +19 -11
  292. data/spec/thinking_sphinx/interfaces/real_time_spec.rb +43 -43
  293. data/spec/thinking_sphinx/interfaces/sql_spec.rb +76 -52
  294. data/spec/thinking_sphinx/masks/pagination_mask_spec.rb +2 -0
  295. data/spec/thinking_sphinx/masks/scopes_mask_spec.rb +2 -0
  296. data/spec/thinking_sphinx/middlewares/active_record_translator_spec.rb +2 -0
  297. data/spec/thinking_sphinx/middlewares/geographer_spec.rb +2 -0
  298. data/spec/thinking_sphinx/middlewares/glazier_spec.rb +2 -0
  299. data/spec/thinking_sphinx/middlewares/inquirer_spec.rb +2 -0
  300. data/spec/thinking_sphinx/middlewares/sphinxql_spec.rb +2 -1
  301. data/spec/thinking_sphinx/middlewares/stale_id_checker_spec.rb +2 -0
  302. data/spec/thinking_sphinx/middlewares/stale_id_filter_spec.rb +2 -0
  303. data/spec/thinking_sphinx/middlewares/valid_options_spec.rb +2 -0
  304. data/spec/thinking_sphinx/panes/attributes_pane_spec.rb +2 -0
  305. data/spec/thinking_sphinx/panes/distance_pane_spec.rb +2 -0
  306. data/spec/thinking_sphinx/panes/excerpts_pane_spec.rb +2 -0
  307. data/spec/thinking_sphinx/panes/weight_pane_spec.rb +3 -1
  308. data/spec/thinking_sphinx/rake_interface_spec.rb +10 -8
  309. data/spec/thinking_sphinx/real_time/attribute_spec.rb +2 -0
  310. data/spec/thinking_sphinx/real_time/callbacks/real_time_callbacks_spec.rb +2 -0
  311. data/spec/thinking_sphinx/real_time/field_spec.rb +2 -0
  312. data/spec/thinking_sphinx/real_time/index_spec.rb +14 -0
  313. data/spec/thinking_sphinx/real_time/interpreter_spec.rb +2 -0
  314. data/spec/thinking_sphinx/real_time/transcribe_instance_spec.rb +35 -0
  315. data/spec/thinking_sphinx/real_time/transcriber_spec.rb +101 -0
  316. data/spec/thinking_sphinx/real_time/translator_spec.rb +17 -0
  317. data/spec/thinking_sphinx/scopes_spec.rb +2 -0
  318. data/spec/thinking_sphinx/search/glaze_spec.rb +2 -0
  319. data/spec/thinking_sphinx/search/query_spec.rb +2 -0
  320. data/spec/thinking_sphinx/search_spec.rb +2 -0
  321. data/spec/thinking_sphinx/wildcard_spec.rb +2 -0
  322. data/spec/thinking_sphinx_spec.rb +2 -0
  323. data/thinking-sphinx.gemspec +7 -5
  324. metadata +62 -25
  325. data/HISTORY +0 -326
  326. data/bin/literals +0 -9
  327. data/lib/thinking_sphinx/commands/index.rb +0 -11
  328. data/lib/thinking_sphinx/controller.rb +0 -12
  329. data/lib/thinking_sphinx/middlewares/attribute_typer.rb +0 -48
  330. data/lib/thinking_sphinx/middlewares/utf8.rb +0 -27
  331. data/lib/thinking_sphinx/sphinxql.rb +0 -23
  332. data/spec/thinking_sphinx/commands/index_spec.rb +0 -26
  333. data/spec/thinking_sphinx/middlewares/attribute_typer_spec.rb +0 -42
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 99b138f1d9126e0d6071b1c86708a5f5b6150701
4
- data.tar.gz: d193fea1540911cff9466850ce3200a4841bd3df
3
+ metadata.gz: 5dc5424b7f11401d4a408f23c666f50ccab97a62
4
+ data.tar.gz: c7d801fd1370b1ea41072dafe3a9493636899d98
5
5
  SHA512:
6
- metadata.gz: e3abb0b6a5c4f6403c166859d32e1bd8078f804e1a9c873e312487d4da47b94d21ac82e9dedba23903f1f97ba23aba5e3eb2c8a8d27e2ac559ec276f3d8af76f
7
- data.tar.gz: 0f612c12b09401f5f8a2c03b8a2e3129b7b7baf06977bb8e89e92dfae40bb9fd8655907c0b15d2c319c2978affbe31c9d35c8ef50f726e01545596ea3abbf06d
6
+ metadata.gz: d9c5cd36cddef1f7b398c8c9cc09ae8ad64ccdaf46d62bcd5e13e77170b87f19900e0f405a1d2604f19acd912180178d64eb4ff18d689ef2294221466b183b76
7
+ data.tar.gz: 0b6189678807dda8e03544872e3db9414f611abf1e5e6ff01a484fb2197ce0a3b3ecac778a62964a64527e26522c7e715383af25375b49ad6d29e2481bdf50b7
@@ -1,9 +1,16 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.2.2
4
- - 2.3.4
5
- - 2.4.1
6
- - jruby-9.1.10.0
3
+ - 2.2.10
4
+ - 2.3.7
5
+ - 2.4.4
6
+ - 2.5.1
7
+ - jruby-9.1.16.0
8
+ addons:
9
+ apt:
10
+ packages:
11
+ - cmake
12
+ - bison
13
+ - flex
7
14
  before_install:
8
15
  - pip install --upgrade --user awscli
9
16
  - gem update --system
@@ -11,8 +18,7 @@ before_install:
11
18
  before_script:
12
19
  - mysql -e 'create database thinking_sphinx;' > /dev/null
13
20
  - psql -c 'create database thinking_sphinx;' -U postgres >/dev/null
14
- - "./bin/loadsphinx $SPHINX_VERSION"
15
- - "./bin/literals"
21
+ - "./bin/loadsphinx $SPHINX_VERSION $SPHINX_ENGINE"
16
22
  - bundle exec appraisal install
17
23
  script: bundle exec appraisal rspec
18
24
  env:
@@ -20,20 +26,16 @@ env:
20
26
  - SPHINX_BIN=ext/sphinx/bin/
21
27
  - secure: cUPinkilBafqDSPsTkl/PXYc2aXNKUQKXGK8poBBMqKN9/wjfJx1DWgtowDKalekdZELxDhc85Ye3bL1xlW4nLjOu+U6Tkt8eNw2Nhs1flodHzA/RyENdBLr/tBHt43EjkrDehZx5sBHmWQY4miHs8AJz0oKO9Ae2inTOHx9Iuc=
22
28
  matrix:
23
- - DATABASE=mysql2 SPHINX_VERSION=2.0.10
24
- - DATABASE=postgresql SPHINX_VERSION=2.0.10
25
- - DATABASE=mysql2 SPHINX_VERSION=2.1.9
26
- - DATABASE=postgresql SPHINX_VERSION=2.1.9
27
- - DATABASE=mysql2 SPHINX_VERSION=2.2.6
28
- - DATABASE=postgresql SPHINX_VERSION=2.2.6
29
+ - DATABASE=mysql2 SPHINX_VERSION=2.1.9 SPHINX_ENGINE=sphinx
30
+ - DATABASE=postgresql SPHINX_VERSION=2.1.9 SPHINX_ENGINE=sphinx
31
+ - DATABASE=mysql2 SPHINX_VERSION=2.2.11 SPHINX_ENGINE=sphinx
32
+ - DATABASE=postgresql SPHINX_VERSION=2.2.11 SPHINX_ENGINE=sphinx
33
+ - DATABASE=mysql2 SPHINX_VERSION=3.0.2 SPHINX_ENGINE=sphinx
34
+ - DATABASE=postgresql SPHINX_VERSION=3.0.2 SPHINX_ENGINE=sphinx
35
+ - DATABASE=mysql2 SPHINX_VERSION=2.6.3 SPHINX_ENGINE=manticore
36
+ - DATABASE=postgresql SPHINX_VERSION=2.6.3 SPHINX_ENGINE=manticore
29
37
  sudo: false
30
38
  addons:
31
39
  postgresql: '9.4'
32
40
  services:
33
41
  - postgresql
34
- matrix:
35
- exclude:
36
- - rvm: jruby-9.1.10.0
37
- env: DATABASE=mysql2 SPHINX_VERSION=2.0.10
38
- - rvm: jruby-9.1.10.0
39
- env: DATABASE=postgresql SPHINX_VERSION=2.0.10
data/Appraisals CHANGED
@@ -1,32 +1,44 @@
1
1
  appraise 'rails_3_2' do
2
2
  gem 'rails', '~> 3.2.22.2'
3
- gem 'rack', '~> 1.0', :platforms => [:ruby_20, :ruby_21]
3
+ gem 'mysql2', '~> 0.3.10', :platform => :ruby
4
4
  end if RUBY_VERSION.to_f <= 2.3
5
5
 
6
6
  appraise 'rails_4_0' do
7
- gem 'rails', '~> 4.0.13'
8
- gem 'rack', '~> 1.0', :platforms => [:ruby_20, :ruby_21]
7
+ gem 'rails', '~> 4.0.13'
8
+ gem 'mysql2', '~> 0.3.10', :platform => :ruby
9
9
  end if RUBY_VERSION.to_f <= 2.3
10
10
 
11
11
  appraise 'rails_4_1' do
12
- gem 'rails', '~> 4.1.15'
13
- gem 'rack', '~> 1.0', :platforms => [:ruby_20, :ruby_21]
12
+ gem 'rails', '~> 4.1.15'
13
+ gem 'mysql2', '~> 0.3.13', :platform => :ruby
14
14
  end if RUBY_VERSION.to_f <= 2.3
15
15
 
16
16
  appraise 'rails_4_2' do
17
- gem 'rails', '~> 4.2.6'
18
- gem 'rack', '~> 1.0', :platforms => [:ruby_20, :ruby_21]
17
+ gem 'rails', '~> 4.2.6'
18
+ gem 'mysql2', '~> 0.4.0', :platform => :ruby
19
19
  end if RUBY_VERSION.to_f <= 2.3
20
20
 
21
21
  appraise 'rails_5_0' do
22
- gem 'rails', '~> 5.0.2'
23
- # gem 'activerecord-jdbc-adapter',
24
- # :git => 'git://github.com/jruby/activerecord-jdbc-adapter.git',
25
- # :branch => 'rails-5',
26
- # :platform => :jruby,
27
- # :ref => 'c3570ce730'
28
- end if RUBY_VERSION.to_f >= 2.2 && RUBY_PLATFORM != 'java'
22
+ if RUBY_PLATFORM == "java"
23
+ gem 'rails', '5.0.6'
24
+ else
25
+ gem 'rails', '~> 5.0.7'
26
+ end
27
+
28
+ gem 'mysql2', '~> 0.4.0', :platform => :ruby
29
+
30
+ gem 'jdbc-mysql', '~> 5.1.36', :platform => :jruby
31
+ gem 'activerecord-jdbcmysql-adapter', '~> 50.0', :platform => :jruby
32
+ gem 'activerecord-jdbcpostgresql-adapter', '~> 50.0', :platform => :jruby
33
+ end if RUBY_PLATFORM != "java" || ENV["SPHINX_VERSION"].to_f > 2.1
29
34
 
30
35
  appraise 'rails_5_1' do
31
- gem 'rails', '~> 5.1.0'
32
- end if RUBY_VERSION.to_f >= 2.2 && RUBY_PLATFORM != 'java'
36
+ gem 'rails', '~> 5.1.0'
37
+ gem 'mysql2', '~> 0.4.0', :platform => :ruby
38
+ end if RUBY_PLATFORM != 'java'
39
+
40
+ appraise 'rails_5_2' do
41
+ gem 'rails', '~> 5.2.0'
42
+ gem 'mysql2', '~> 0.5.0', :platform => :ruby
43
+ gem 'pg', '~> 1.0', :platform => :ruby
44
+ end if RUBY_PLATFORM != 'java' && RUBY_VERSION.to_f >= 2.3
@@ -0,0 +1,538 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project (at least, from v3.0.0 onwards) are documented in this file.
4
+
5
+ ## 4.0.0 - 2018-04-10
6
+
7
+ [Release Notes](https://github.com/pat/thinking-sphinx/releases/tag/v4.0.0)
8
+
9
+ ### Added
10
+
11
+ * Support Sphinx 3.0.
12
+ * Allow disabling of docinfo setting via `skip_docinfo: true` in `config/thinking_sphinx.yml`.
13
+ * Support merging of delta indices into their core counterparts using ts:merge.
14
+ * Support UNIX sockets as an alternative for TCP connections to the daemon (MRI-only).
15
+ * Translate relative paths to absolute when generating configuration when `absolute_paths: true` is set per environment in `config/thinking_sphinx.yml`.
16
+
17
+ ### Changed
18
+
19
+ * Drop Sphinx 2.0 support.
20
+ * Drop auto-typing of filter values.
21
+ * INDEX_FILTER environment variable is applied when running ts:index on SQL-backed indices.
22
+ * Drop MRI 2.0/2.1 support.
23
+ * Display a useful error message if processing real-time indices but the daemon isn't running.
24
+ * Refactor interface code into separate command classes, and allow for a custom rake interface.
25
+ * Add frozen_string_literal pragma comments.
26
+ * Log exceptions when processing real-time indices, but don't stop.
27
+ * Update polymorphic properties to support Rails 5.2.
28
+ * Allow configuration of the index guard approach.
29
+ * Output a warning if guard files exist when calling ts:index.
30
+ * Delete index guard files as part of ts:rebuild and ts:clear.
31
+
32
+ ### Fixed
33
+
34
+ * Handle situations where no exit code is provided for Sphinx binary calls.
35
+ * Don't attempt to interpret indices for models that don't have a database table.
36
+
37
+ ## 3.4.2 - 2017-09-29
38
+
39
+ [Release Notes](https://github.com/pat/thinking-sphinx/releases/tag/v3.4.2)
40
+
41
+ ### Changed
42
+
43
+ * Allow use of deletion callbacks for rollback events.
44
+ * Remove extra deletion code in the Populator - it's also being done by the real-time rake interface.
45
+
46
+ ### Fixed
47
+
48
+ * Real-time callback syntax for namespaced models accepts a string (as documented).
49
+ * Fix up logged warnings.
50
+ * Add missing search options to known values to avoid incorrect warnings.
51
+
52
+ ## 3.4.1 - 2017-08-29
53
+
54
+ [Release Notes](https://github.com/pat/thinking-sphinx/releases/tag/v3.4.1)
55
+
56
+ ### Changed
57
+
58
+ * Treat "Lost connection to MySQL server" as a connection error (Manuel Schnitzer).
59
+
60
+ ### Fixed
61
+
62
+ * Index normalisation will now work even when index model tables don't exist.
63
+
64
+ ## 3.4.0 - 2017-08-28
65
+
66
+ [Release Notes](https://github.com/pat/thinking-sphinx/releases/tag/v3.4.0)
67
+
68
+ ### Added
69
+
70
+ * Rake tasks are now unified, so the original tasks will operate on real-time indices as well.
71
+ * Output warnings when unknown options are used in search calls.
72
+ * Allow generation of a single real-time index (Tim Brown).
73
+ * Automatically use UTF8 in Sphinx for encodings that are extensions of UTF8.
74
+ * Basic type checking for attribute filters.
75
+
76
+ ### Changed
77
+
78
+ * Delta callback logic now prioritises checking for high level settings rather than model changes.
79
+ * Allow for unsaved records when calculating document ids (and return nil).
80
+ * Display SphinxQL deletion statements in the log.
81
+ * Add support for Ruby's frozen string literals feature.
82
+ * Use saved_changes if it's available (in Rails 5.1+).
83
+ * Set a default connection timeout of 5 seconds.
84
+ * Don't search multi-table inheritance ancestors.
85
+ * Handle non-computable queries as parse errors.
86
+
87
+ ### Fixed
88
+
89
+ * Index normalisation now occurs consistently, and removes unneccesary sphinx_internal_class_name fields from real-time indices.
90
+ * Fix Sphinx connections in JRuby.
91
+ * Fix long SphinxQL query handling in JRuby.
92
+ * Always close the SphinxQL connection if Innertube's asking (@cmaion).
93
+ * Get bigint primary keys working in Rails 5.1.
94
+ * Fix handling of attached starts of Sphinx (via Henne Vogelsang).
95
+ * Fix multi-field conditions.
96
+ * Use the base class of STI models for polymorphic join generation (via Andrés Cirugeda).
97
+ * Ensure ts:index now respects rake silent/quiet flags.
98
+
99
+ ## 3.3.0 - 2016-12-13
100
+
101
+ [Release Notes](https://github.com/pat/thinking-sphinx/releases/tag/v3.3.0)
102
+
103
+ ### Added
104
+
105
+ * Real-time callbacks can now be used with after_commit hooks if that's preferred over after_save.
106
+ * Allow for custom batch sizes when populating real-time indices.
107
+
108
+ ### Changed
109
+
110
+ * Only toggle the delta value if the record has changed or is new (rather than on every single save call).
111
+ * Delta indexing is now quiet by default (rather than verbose).
112
+ * Use Riddle's reworked command interface for interacting with Sphinx's command-line tools.
113
+ * Respect Rake's quiet and silent flags for the Thinking Sphinx rake tasks.
114
+ * ts:start and ts:stop tasks default to verbose.
115
+ * Sort engine paths for loading indices to ensure they're consistent.
116
+ * Custom exception class for invalid database adapters.
117
+ * Memoize the default primary keys per context.
118
+
119
+ ### Fixed
120
+
121
+ * Explicit source method in the SQLQuery Builder instead of relying on method missing, thus avoiding any global methods named 'source' (Asaf Bartov).
122
+ * Load indices before deleting index files, to ensure the files are actually found and deleted.
123
+ * Avoid loading ActiveRecord earlier than necessary. This avoids loading Rails out of order, which caused problems with Rails 5.
124
+ * Handle queries that are too long for Sphinx.
125
+ * Improve Rails 5 / JRuby support.
126
+ * Fixed handling of multiple field tokens in wildcarding logic.
127
+ * Ensure custom primary key columns are handled consistently (Julio Monteiro).
128
+
129
+ ## 3.2.0 - 2016-05-13
130
+
131
+ [Release Notes](https://github.com/pat/thinking-sphinx/releases/tag/v3.2.0)
132
+
133
+ ### Added
134
+
135
+ * Add JSON attribute support for real-time indices.
136
+ * Add ability to disable *all* Sphinx-related callbacks via ThinkingSphinx::Callbacks.suspend! and ThinkingSphinx::Callbacks.resume!. Particularly useful for unit tests.
137
+ * Add native OutOfBoundsError for search queries outside the pagination bounds.
138
+ * Support MySQL SSL options on a per-index level (@arrtchiu).
139
+ * Allow for different indexing strategies (e.g. all at once, or one by one).
140
+ * Allow rand_seed as a select option (Mattia Gheda).
141
+ * Add primary_key option for index definitions (Nathaneal Gray).
142
+ * Add ability to start searchd in the foreground (Andrey Novikov).
143
+
144
+ ### Changed
145
+
146
+ * Improved error messages for duplicate property names and missing columns.
147
+ * Don't populate search results when requesting just the count values (Andrew Roth).
148
+ * Reset delta column before core indexing begins (reverting behaviour introduced in 3.1.0). See issue #958 for further discussion.
149
+ * Use Sphinx's bulk insert ability (Chance Downs).
150
+ * Reduce memory/object usage for model references (Jonathan del Strother).
151
+ * Disable deletion callbacks when real-time indices are in place and all other real-time callbacks are disabled.
152
+ * Only use ERB to parse the YAML file if ERB is loaded.
153
+
154
+ ### Fixed
155
+
156
+ * Ensure SQL table aliases are reliable for SQL-backed index queries.
157
+ * Fixed mysql2 compatibility for memory references (Roman Usherenko).
158
+ * Fixed JRuby compatibility with camelCase method names (Brandon Dewitt).
159
+ * Fix stale id handling for multiple search contexts (Jonathan del Strother).
160
+ * Handle quoting of namespaced tables (Roman Usherenko).
161
+ * Make preload_indices thread-safe.
162
+ * Improved handling of marshalled/demarshalled search results.
163
+
164
+ ## 3.1.4 - 2015-06-01
165
+
166
+ [Release Notes](https://github.com/pat/thinking-sphinx/releases/tag/v3.1.4)
167
+
168
+ ### Added
169
+
170
+ * Add JSON as a Sphinx type for attributes (Daniel Vandersluis).
171
+ * minimal_group_by? can now be set in config/thinking_sphinx.yml to automatically apply to all index definitions.
172
+
173
+ ### Changed
174
+
175
+ * Add a contributor code of conduct.
176
+ * Remove polymorphic association and HABTM query support (when related to Thinking Sphinx) when ActiveRecord 3.2 is involved.
177
+ * Remove default charset_type - no longer required for Sphinx 2.2.
178
+ * Removing sql_query_info setting, as it's no longer used by Sphinx (nor is it actually used by Thinking Sphinx).
179
+
180
+ ### Fixed
181
+
182
+ * Kaminari expects prev_page to be available.
183
+ * Don't try to delete guard files if they don't exist (@exAspArk).
184
+ * Handle database settings reliably, now that ActiveRecord 4.2 uses strings all the time.
185
+ * More consistent with escaping table names.
186
+ * Bug fix for association creation (with polymophic fields/attributes).
187
+
188
+ ## 3.1.3 - 2015-01-21
189
+
190
+ [Release Notes](https://github.com/pat/thinking-sphinx/releases/tag/v3.1.3)
191
+
192
+ ### Added
193
+
194
+ * Allow for custom offset references with the :offset_as option - thus one model across many schemas with Apartment can be treated differently.
195
+ * Allow for custom IndexSet classes.
196
+
197
+ ### Changed
198
+
199
+ * Log excerpt SphinxQL queries just like the search queries.
200
+ * Load Railtie if Rails::Railtie is defined, instead of just Rails (Andrew Cone).
201
+ * Convert raw Sphinx results to an array when querying (Bryan Ricker).
202
+ * Add bigint support for real-time indices, and use bigints for the sphinx_internal_id attribute (mapped to model primary keys) (Chance Downs).
203
+
204
+ ### Fixed
205
+
206
+ * Generate de-polymorphised associations properly for Rails 4.2
207
+ * Use reflect_on_association instead of reflections, to stick to the public ActiveRecord::Base API.
208
+ * Don't load ActiveRecord early - fixes a warning in Rails 4.2.
209
+ * Don't double-up on STI filtering, already handled by Rails.
210
+
211
+ ## 3.1.2 - 2014-11-04
212
+
213
+ [Release Notes](https://github.com/pat/thinking-sphinx/releases/tag/v3.1.2)
214
+
215
+ ### Added
216
+
217
+ * Allow for custom paths for index files using :path option in the ThinkingSphinx::Index.define call.
218
+ * Allow the binlog path to be an empty string (Bobby Uhlenbrock).
219
+ * Add status task to report on whether Sphinx is running.
220
+ * Real-time index callbacks can take a block for dynamic scoping.
221
+ * Allow casting of document ids pre-offset as bigints (via big_documents_id option).
222
+
223
+ ### Changed
224
+
225
+ * regenerate task now only deletes index files for real-time indices.
226
+ * Raise an exception when a populated search query is modified (as it can't be requeried).
227
+ * Log indices that aren't processed due to guard files existing.
228
+ * Paginate records by 1000 results at a time when flagging as deleted.
229
+ * Default the Capistrano TS Rails environment to use rails_env, and then fall back to stage.
230
+ * rebuild task uses clear between stopping the daemon and indexing.
231
+
232
+ ### Fixed
233
+
234
+ * Ensure indexing guard files are removed when an exception is raised (Bobby Uhlenbrock).
235
+ * Don't update real-time indices for objects that are not persisted (Chance Downs).
236
+ * Use STI base class for polymorphic association replacements.
237
+ * Convert database setting keys to symbols for consistency with Rails (@dimko).
238
+ * Field weights and other search options are now respected from set_property.
239
+ * Models with more than one index have correct facet counts (using Sphinx 2.1.x or newer).
240
+ * Some association fixes for Rails 4.1.
241
+ * Clear connections when raising connection errors.
242
+
243
+ ## 3.1.1 - 2014-04-22
244
+
245
+ [Release Notes](https://github.com/pat/thinking-sphinx/releases/tag/v3.1.1)
246
+
247
+ ### Added
248
+
249
+ * Allow for common section in generated Sphinx configuration files for Sphinx 2.2.x (disabled by default, though) (Trevor Smith).
250
+ * Basic support for HABTM associations and MVAs with query/ranged-query sources.
251
+ * Real-time indices callbacks can be disabled (useful for unit tests).
252
+ * ThinkingSphinx::Test has a clear method and no-index option for starting for real-time setups.
253
+ * Allow disabling of distributed indices.
254
+
255
+ ### Changed
256
+
257
+ * Include full statements when query execution errors are raised (uglier, but more useful when debugging).
258
+ * Connection error messages now mention Sphinx, instead of just MySQL.
259
+ * Raise an exception when a referenced column does not exist.
260
+ * Capistrano tasks use thinking_sphinx_rails_env (defaults to standard environment) (Robert Coleman).
261
+ * Alias group and count columns for easier referencing in other clauses.
262
+ * Log real-time index updates (Demian Ferreiro).
263
+ * All indices now respond to a public attributes method.
264
+
265
+ ### Fixed
266
+
267
+ * Don't apply attribute-only updates to real-time indices.
268
+ * Don't instantiate blank strings (via inheritance type columns) as constants.
269
+ * Don't presume all indices for a model have delta pairs, even if one does.
270
+ * Always use connection options for connection information.
271
+ * respond_to? works reliably with masks (Konstantin Burnaev).
272
+ * Avoid null values in MVA query/ranged-query sources.
273
+ * Don't send unicode null characters to real-time Sphinx indices.
274
+ * :populate option is now respected for single-model searches.
275
+ * :thinking_sphinx_roles is now used consistently in Capistrano v3 tasks.
276
+ * Only expand log directory if it exists.
277
+ * Handle JDBC connection errors appropriately (Adam Hutchison).
278
+ * Fixing wildcarding of Unicode strings.
279
+ * Improved handling of association searches with real-time indices, including via has_many :though associations (Rob Anderton).
280
+
281
+ ## 3.1.0 - 2014-01-11
282
+
283
+ [Release Notes](https://github.com/pat/thinking-sphinx/releases/tag/v3.1.0)
284
+
285
+ ### Added
286
+
287
+ * Support for Capistrano v3 (Alexander Tipugin).
288
+ * JRuby support (with Sphinx 2.1 or newer).
289
+ * Support for Sphinx 2.2.x's HAVING and GROUP N BY SphinxQL options.
290
+ * Adding max_predicted_time search option (Sphinx 2.2.x).
291
+ * Wildcard/starring can be applied directly to strings using ThinkingSphinx::Query.wildcard('pancakes'), and escaping via ThinkingSphinx::Query.escape('pancakes').
292
+ * Capistrano recipe now includes tasks for realtime indices.
293
+ * :group option within :sql options in a search call is passed through to the underlying ActiveRecord relation (Siarhei Hanchuk).
294
+ * Persistent connections can be disabled if you wish.
295
+ * Track what's being indexed, and don't double-up while indexing is running. Single indices (e.g. deltas) can be processed while a full index is happening, though.
296
+ * Pass through :delta_options to delta processors (Timo Virkalla).
297
+ * All delta records can have their core pairs marked as deleted after a suspended delta (use ThinkingSphinx::Deltas.suspend_and_update instead of ThinkingSphinx::Deltas.suspend).
298
+ * Set custom database settings within the index definition, using the set_database method. A more sane approach with multiple databases.
299
+
300
+ ### Changed
301
+
302
+ * Updating Riddle requirement to >= 1.5.10.
303
+ * Extracting join generation into its own gem: Joiner.
304
+ * Geodist calculation is now prepended to the SELECT statement, so it can be referred to by other dynamic attributes.
305
+ * Auto-wildcard/starring (via :star => true) now treats escaped characters as word separators.
306
+ * Capistrano recipe no longer automatically adds thinking_sphinx:index and thinking_sphinx:start to be run after deploy:cold.
307
+ * UTF-8 forced encoding is now disabled by default (in line with Sphinx 2.1.x).
308
+ * Sphinx functions are now the default, instead of the legacy special variables (in line with Sphinx 2.1.x).
309
+ * Rails 3.1 is no longer supported.
310
+ * MRI 1.9.2 is no longer supported.
311
+ * Insist on at least * for SphinxQL SELECT statements.
312
+ * Reset the delta column to true after core indexing is completed, instead of before, and don't filter out delta records from the core source.
313
+ * Provide a distributed index per model that covers both core and delta indices.
314
+
315
+ ### Fixed
316
+
317
+ * Indices will be detected in Rails engines upon configuration.
318
+ * Destroy callbacks are ignored for non-persisted objects.
319
+ * Blank STI values are converted to the parent class in Sphinx index data (Jonathan Greenberg).
320
+ * Track indices on parent STI models when marking documents as deleted.
321
+ * Separate per_page/max_matches values are respected in facet searches (Timo Virkkala).
322
+ * Don't split function calls when casting timestamps (Timo Virkalla).
323
+
324
+ ## 3.0.6 - 2013-10-20
325
+
326
+ [Release Notes](https://github.com/pat/thinking-sphinx/releases/tag/v3.0.6)
327
+
328
+ ### Added
329
+
330
+ * Raise an error if no indices match the search criteria (Bryan Ricker).
331
+ * skip_time_zone setting is now available per environment via config/thinking_sphinx.yml to avoid the sql_query_pre time zone command.
332
+ * Added new search options in Sphinx 2.1.x.
333
+ * Added ability to disable UTF-8 forced encoding, now that Sphinx 2.1.2 returns UTF-8 strings by default. This will be disabled by default in Thinking Sphinx 3.1.0.
334
+ * Added ability to switch between Sphinx special variables and the equivalent functions. Sphinx 2.1.x requires the latter, and that behaviour will become the default in Sphinx 3.1.0.
335
+ * Adding search_for_ids on scoped search calls.
336
+ * MySQL users can enable a minimal GROUP BY statement, to speed up queries: set_property :minimal_group_by? => true.
337
+
338
+ ### Changed
339
+
340
+ * Updating Riddle dependency to be >= 1.5.9.
341
+ * Separated directory preparation from data generation for real-time index (re)generation tasks.
342
+ * Have tests index UTF-8 characters where appropriate (Pedro Cunha).
343
+ * Always use DISTINCT in group concatenation.
344
+ * Sphinx connection failures now have their own class, ThinkingSphinx::ConnectionError, instead of the standard Mysql2::Error.
345
+ * Don't clobber custom :select options for facet searches (Timo Virkkala).
346
+ * Automatically load Riddle's Sphinx 2.0.5 compatability changes.
347
+ * Realtime fields and attributes now accept symbols as well as column objects, and fields can be sortable (with a _sort prefix for the matching attribute).
348
+ * Insist on the log directory existing, to ensure correct behaviour for symlinked paths. (Michael Pearson).
349
+ * Rake's silent mode is respected for indexing (@endoscient).
350
+
351
+ ### Fixed
352
+
353
+ * Cast every column to a timestamp for timestamp attributes with multiple columns.
354
+ * Don't use Sphinx ordering if SQL order option is supplied to a search.
355
+ * Custom middleware and mask options now function correctly with model-scoped searches.
356
+ * Suspended deltas now no longer update core indices as well.
357
+ * Use alphabetical ordering for index paths consistently (@grin).
358
+ * Convert very small floats to fixed format for geo-searches.
359
+
360
+ ## 3.0.5 - 2013-08-26
361
+
362
+ ### Added
363
+
364
+ * Allow scoping of real-time index models.
365
+
366
+ ### Changed
367
+
368
+ * Updating Riddle dependency to be >= 1.5.8.
369
+ * Real-time index population presentation and logic are now separated.
370
+ * Using the connection pool for update callbacks, excerpts, deletions.
371
+ * Don't add the sphinx_internal_class_name unless STI models are indexed.
372
+ * Use Mysql2's reconnect option and have it turned on by default.
373
+ * Improved auto-starring with escaped characters.
374
+
375
+ ### Fixed
376
+
377
+ * Respect existing sql_query_range/sql_query_info settings.
378
+ * Don't add select clauses or joins to sql_query if they're for query/ranged-query properties.
379
+ * Set database timezones as part of the indexing process.
380
+ * Chaining scopes with just options works again.
381
+
382
+ ## 3.0.4 - 2013-07-09
383
+
384
+ ### Added
385
+
386
+ * ts:regenerate rake task for rebuilding Sphinx when realtime indices are involved.
387
+ * ts:clear task removes all Sphinx index and binlog files.
388
+ * Facet search calls now respect the limit option (which otherwise defaults to max_matches) (Demian Ferreiro).
389
+ * Excerpts words can be overwritten with the words option (@groe).
390
+ * The :facets option can be used in facet searches to limit which facets are queried.
391
+ * A separate role can be set for Sphinx actions with Capistrano (Andrey Chernih).
392
+ * Facet searches can now be called from Sphinx scopes.
393
+
394
+ ### Changed
395
+
396
+ * Updating Riddle dependency to be >= 1.5.7.
397
+ * Glaze now responds to respond_to? (@groe).
398
+ * Deleted ActiveRecord objects are deleted in realtime indices as well.
399
+ * Realtime callbacks are no longer automatically added, but they're now more flexible (for association situations).
400
+ * Cleaning and refactoring so Code Climate ranks this as A-level code (Philip Arndt, Shevaun Coker, Garrett Heinlen).
401
+ * Exceptions raised when communicating with Sphinx are now mentioned in the logs when queries are retried (instead of STDOUT).
402
+ * Excerpts now use just the query and standard conditions, instead of parsing Sphinx's keyword metadata (which had model names in it).
403
+ * Get database connection details from ActiveRecord::Base, not each model, as this is where changes are reflected.
404
+ * Default Sphinx scopes are applied to new facet searches.
405
+
406
+ ### Fixed
407
+
408
+ * Empty queries with the star option set to true are handled gracefully.
409
+ * Excerpts are now wildcard-friendly.
410
+ * Facet searches now use max_matches value (with a default of 1000) to ensure as many results as possible are returned.
411
+ * The settings cache is now cleared when the configuration singleton is reset (Pedro Cunha).
412
+ * Escaped @'s in queries are considered part of each word, instead of word separators.
413
+ * Internal class name conditions are ignored with auto-starred queries.
414
+ * RDoc doesn't like constant hierarchies split over multiple lines.
415
+
416
+ ## 3.0.3 - 2013-05-07
417
+
418
+ ### Added
419
+
420
+ * INDEX_ONLY environment flag is passed through when invoked through Capistrano (Demian Ferreiro).
421
+ * use_64_bit option returns as cast_to_timestamp instead (Denis Abushaev).
422
+ * Collection of hooks (lambdas) that get called before indexing. Useful for delta libraries.
423
+
424
+ ### Changed
425
+
426
+ * Updating Riddle dependency to be >= 1.5.6
427
+ * Delta jobs get common classes to allow third-party delta behaviours to leverage Thinking Sphinx.
428
+ * Raise ThinkingSphinx::MixedScopesError if a search is called through an ActiveRecord scope.
429
+ * GroupEnumeratorsMask is now a default mask, as masks need to be in place before search results are populated/the middleware is called (and previously it was being added within a middleware call).
430
+ * The current_page method is now a part of ThinkingSphinx::Search, as it is used when populating results.
431
+
432
+ ### Fixed
433
+
434
+ * Update to association handling for Rails/ActiveRecord 4.0.0.rc1.
435
+ * Cast and concatenate multi-column attributes correctly.
436
+ * Don't load fields or attributes when building a real-time index - otherwise the index is translated before it has a chance to be built.
437
+ * Default search panes are cloned for each search.
438
+ * Index-level settings (via set_property) are now applied consistently after global settings (in thinking_sphinx.yml).
439
+ * All string values returned from Sphinx are now properly converted to UTF8.
440
+ * The default search masks are now cloned for each search, instead of referring to the constant (and potentially modifying it often).
441
+
442
+ ## 3.0.2 - 2013-03-23
443
+
444
+ ### Added
445
+
446
+ * Ruby 2.0 support.
447
+ * Rails 4.0.0 beta1 support.
448
+ * Indexes defined in app/indices in engines are now loaded (Antonio Tapiador del Dujo).
449
+ * Query errors are classified as such, instead of getting the base SphinxError.
450
+
451
+ ### Changed
452
+
453
+ * per_page now accepts an optional paging limit, to match WillPaginate's behaviour. If none is supplied, it just returns the page size.
454
+ * Strings and regular expressions in ThinkingSphinx::Search::Query are now treated as UTF-8.
455
+ * Setting a custom framework will rebuild the core configuration around its provided settings (path and environment).
456
+ * Search masks don't rely on respond_to?, and so Object/Kernel methods are passed through to the underlying array instead.
457
+ * Empty search conditions are now ignored, instead of being appended with no value (Nicholas Klick).
458
+ * Custom conditions are no longer added to the sql_query_range value, as they may involve associations.
459
+
460
+ ### Fixed
461
+
462
+ * :utf8? option within index definitions is now supported, and defaults to true if the database configuration's encoding is set to 'utf8'.
463
+ * indices_location and configuration_file values in thinking_sphinx.yml will be applied to the configuration.
464
+ * Primary keys that are not 'id' now work correctly.
465
+ * Search options specified in index definitions and thinking_sphinx.yml are now used in search requests (eg: max_matches, field_weights).
466
+ * Custom association conditions are no longer presumed to be an array.
467
+ * Capistrano tasks use the correct ts rake task prefix (David Celis).
468
+
469
+ ## 3.0.1 - 2013-02-04
470
+
471
+ ### Added
472
+
473
+ * Provide Capistrano deployment tasks (David Celis).
474
+ * Allow specifying of Sphinx version. Is only useful for Flying Sphinx purposes at this point - has no impact on Riddle or Sphinx.
475
+ * Support new JDBC configuration style (when JDBC can be used) (Kyle Stevens).
476
+ * Mysql2::Errors are wrapped as ThinkingSphinx::SphinxErrors, with subclasses of SyntaxError and ParseError used appropriately. Syntax and parse errors do not prompt a retry on a new connection.
477
+ * Polymorphic associations can be used within index definitions when the appropriate classes are set out.
478
+ * Allow custom strings for SQL joins in index definitions.
479
+ * indexer and searchd settings are added to the appropriate objects from config/thinking_sphinx.yml (@ygelfand).
480
+
481
+ ### Changed
482
+
483
+ * Use connection pool for search queries. If a query fails, it will be retried on a new connection before raising if necessary.
484
+ * Glaze always passes methods through to the underlying ActiveRecord::Base object if they don't exist on any of the panes.
485
+
486
+ ### Fixed
487
+
488
+ * Referring to associations via polymorphic associations in an index definition now works.
489
+ * Don't override foreign keys for polymorphic association replacements.
490
+ * Quote namespaced model names in class field condition.
491
+ * New lines are maintained and escaped in custom source queries.
492
+ * Subclasses of indexed models fire delta callbacks properly.
493
+ * Thinking Sphinx can be loaded via thinking/sphinx, to satisfy Bundler.
494
+ * New lines are maintained and escaped in sql_query values.
495
+
496
+ ## 3.0.0 - 2013-01-02
497
+
498
+ ### Added
499
+
500
+ * Initial realtime index support, including the ts:generate task for building index datasets. Sphinx 2.0.6 is required.
501
+ * SphinxQL connection pooling via the Innertube gem.
502
+
503
+ ### Changed
504
+
505
+ * Updating Riddle dependency to 1.5.4.
506
+ * UTF-8 is now the default charset again (as it was in earlier Thinking Sphinx versions).
507
+ * Removing ts:version rake task.
508
+
509
+ ### Fixed
510
+
511
+ * Respect source options as well as underlying settings via the set_property method in index definitions.
512
+ * Load real-time index definitions when listing fields, attributes, and/or conditions.
513
+
514
+ ## 3.0.0.rc - 2012-12-22
515
+
516
+ ### Added
517
+
518
+ * Source type support (query and ranged query) for both attributes and fields. Custom SQL strings can be supplied as well.
519
+ * Wordcount attributes and fields now supported.
520
+ * Support for Sinatra and other non-Rails frameworks.
521
+ * A sphinx scope can be defined as the default.
522
+ * An index can have multiple sources, by using define_source within the index definition.
523
+ * sanitize_sql is available within an index definition.
524
+ * Providing :prefixes => true or :infixes => true as an option when declaring a field means just the noted fields have infixes/prefixes applied.
525
+ * ThinkingSphinx::Search#query_time returns the time Sphinx took to make the query.
526
+ * Namespaced model support.
527
+ * Default settings for index definition arguments can be set in config/thinking_sphinx.yml.
528
+ * A custom Riddle/Sphinx controller can be supplied. Useful for Flying Sphinx to have an API layer over Sphinx commands, without needing custom gems for different Thinking Sphinx/Flying Sphinx combinations.
529
+
530
+ ### Fixed
531
+
532
+ * Correctly escape nulls in inheritance column (Darcy Laycock).
533
+ * Use ThinkingSphinx::Configuration#render_to_file instead of ThinkingSphinx::Configuration#build in test helpers (Darcy Laycock).
534
+ * Suppressing delta output in test helpers now works (Darcy Laycock).
535
+
536
+ ## 3.0.0.pre - 2012-10-06
537
+
538
+ First pre-release of v3. Not quite feature complete, but the important stuff is certainly covered. See the README for more the finer details.