thinking-sphinx 4.3.2 → 5.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +152 -0
  3. data/.travis.yml +16 -21
  4. data/Appraisals +11 -20
  5. data/CHANGELOG.markdown +79 -0
  6. data/README.textile +15 -17
  7. data/bin/loadsphinx +30 -7
  8. data/lib/thinking_sphinx.rb +5 -4
  9. data/lib/thinking_sphinx/active_record.rb +1 -0
  10. data/lib/thinking_sphinx/active_record/association_proxy.rb +1 -2
  11. data/lib/thinking_sphinx/active_record/association_proxy/attribute_finder.rb +1 -1
  12. data/lib/thinking_sphinx/active_record/attribute/sphinx_presenter.rb +1 -1
  13. data/lib/thinking_sphinx/active_record/base.rb +17 -6
  14. data/lib/thinking_sphinx/active_record/callbacks/association_delta_callbacks.rb +21 -0
  15. data/lib/thinking_sphinx/active_record/callbacks/delete_callbacks.rb +1 -1
  16. data/lib/thinking_sphinx/active_record/callbacks/delta_callbacks.rb +3 -2
  17. data/lib/thinking_sphinx/active_record/callbacks/update_callbacks.rb +1 -1
  18. data/lib/thinking_sphinx/active_record/interpreter.rb +4 -4
  19. data/lib/thinking_sphinx/active_record/sql_source.rb +12 -0
  20. data/lib/thinking_sphinx/active_record/sql_source/template.rb +2 -2
  21. data/lib/thinking_sphinx/callbacks.rb +9 -0
  22. data/lib/thinking_sphinx/callbacks/appender.rb +59 -0
  23. data/lib/thinking_sphinx/commands/index_real_time.rb +1 -3
  24. data/lib/thinking_sphinx/connection.rb +4 -0
  25. data/lib/thinking_sphinx/connection/client.rb +6 -1
  26. data/lib/thinking_sphinx/core/index.rb +5 -2
  27. data/lib/thinking_sphinx/deletion.rb +18 -17
  28. data/lib/thinking_sphinx/errors.rb +1 -1
  29. data/lib/thinking_sphinx/index_set.rb +7 -3
  30. data/lib/thinking_sphinx/middlewares/sphinxql.rb +1 -1
  31. data/lib/thinking_sphinx/railtie.rb +14 -1
  32. data/lib/thinking_sphinx/real_time.rb +17 -0
  33. data/lib/thinking_sphinx/real_time/index.rb +5 -3
  34. data/lib/thinking_sphinx/real_time/index/template.rb +12 -0
  35. data/lib/thinking_sphinx/real_time/interpreter.rb +8 -6
  36. data/lib/thinking_sphinx/real_time/populator.rb +5 -2
  37. data/lib/thinking_sphinx/real_time/processor.rb +36 -0
  38. data/lib/thinking_sphinx/real_time/transcriber.rb +41 -19
  39. data/lib/thinking_sphinx/real_time/translator.rb +1 -0
  40. data/lib/thinking_sphinx/settings.rb +13 -9
  41. data/lib/thinking_sphinx/subscribers/populator_subscriber.rb +0 -4
  42. data/spec/acceptance/big_integers_spec.rb +1 -1
  43. data/spec/acceptance/geosearching_spec.rb +13 -3
  44. data/spec/acceptance/merging_spec.rb +1 -1
  45. data/spec/acceptance/real_time_updates_spec.rb +2 -2
  46. data/spec/acceptance/sql_deltas_spec.rb +15 -3
  47. data/spec/acceptance/support/sphinx_helpers.rb +4 -4
  48. data/spec/acceptance/suspended_deltas_spec.rb +3 -3
  49. data/spec/internal/app/indices/article_index.rb +0 -1
  50. data/spec/internal/app/indices/colour_index.rb +7 -0
  51. data/spec/internal/app/models/admin/person.rb +3 -1
  52. data/spec/internal/app/models/album.rb +3 -1
  53. data/spec/internal/app/models/animal.rb +1 -0
  54. data/spec/internal/app/models/article.rb +2 -0
  55. data/spec/internal/app/models/bird.rb +1 -0
  56. data/spec/internal/app/models/book.rb +2 -0
  57. data/spec/internal/app/models/car.rb +1 -1
  58. data/spec/internal/app/models/city.rb +2 -0
  59. data/spec/internal/app/models/colour.rb +2 -0
  60. data/spec/internal/app/models/product.rb +1 -1
  61. data/spec/internal/app/models/tee.rb +5 -0
  62. data/spec/internal/app/models/user.rb +2 -0
  63. data/spec/internal/config/database.yml +6 -1
  64. data/spec/internal/db/schema.rb +1 -0
  65. data/spec/thinking_sphinx/active_record/callbacks/update_callbacks_spec.rb +2 -1
  66. data/spec/thinking_sphinx/active_record/index_spec.rb +0 -12
  67. data/spec/thinking_sphinx/active_record/interpreter_spec.rb +15 -14
  68. data/spec/thinking_sphinx/active_record/sql_source_spec.rb +41 -3
  69. data/spec/thinking_sphinx/connection/mri_spec.rb +49 -0
  70. data/spec/thinking_sphinx/deletion_spec.rb +5 -4
  71. data/spec/thinking_sphinx/index_set_spec.rb +28 -12
  72. data/spec/thinking_sphinx/middlewares/sphinxql_spec.rb +2 -1
  73. data/spec/thinking_sphinx/real_time/index_spec.rb +51 -13
  74. data/spec/thinking_sphinx/real_time/interpreter_spec.rb +14 -14
  75. data/spec/thinking_sphinx/real_time/transcriber_spec.rb +9 -1
  76. data/thinking-sphinx.gemspec +3 -5
  77. metadata +17 -11
  78. data/spec/acceptance/connection_spec.rb +0 -25
@@ -1,25 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'acceptance/spec_helper'
4
-
5
- RSpec.describe 'Connections', :live => true do
6
- let(:maximum) { (2 ** 23) - 5 }
7
- let(:query) { String.new "SELECT * FROM book_core WHERE MATCH('')" }
8
- let(:difference) { maximum - query.length }
9
-
10
- it 'allows normal length queries through' do
11
- expect {
12
- ThinkingSphinx::Connection.take do |connection|
13
- connection.execute query.insert(-3, 'a' * difference)
14
- end
15
- }.to_not raise_error
16
- end
17
-
18
- it 'does not allow overly long queries' do
19
- expect {
20
- ThinkingSphinx::Connection.take do |connection|
21
- connection.execute query.insert(-3, 'a' * (difference + 5))
22
- end
23
- }.to raise_error(ThinkingSphinx::QueryLengthError)
24
- end
25
- end