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.
- checksums.yaml +4 -4
- data/.circleci/config.yml +152 -0
- data/.travis.yml +16 -21
- data/Appraisals +11 -20
- data/CHANGELOG.markdown +79 -0
- data/README.textile +15 -17
- data/bin/loadsphinx +30 -7
- data/lib/thinking_sphinx.rb +5 -4
- data/lib/thinking_sphinx/active_record.rb +1 -0
- data/lib/thinking_sphinx/active_record/association_proxy.rb +1 -2
- data/lib/thinking_sphinx/active_record/association_proxy/attribute_finder.rb +1 -1
- data/lib/thinking_sphinx/active_record/attribute/sphinx_presenter.rb +1 -1
- data/lib/thinking_sphinx/active_record/base.rb +17 -6
- data/lib/thinking_sphinx/active_record/callbacks/association_delta_callbacks.rb +21 -0
- data/lib/thinking_sphinx/active_record/callbacks/delete_callbacks.rb +1 -1
- data/lib/thinking_sphinx/active_record/callbacks/delta_callbacks.rb +3 -2
- data/lib/thinking_sphinx/active_record/callbacks/update_callbacks.rb +1 -1
- data/lib/thinking_sphinx/active_record/interpreter.rb +4 -4
- data/lib/thinking_sphinx/active_record/sql_source.rb +12 -0
- data/lib/thinking_sphinx/active_record/sql_source/template.rb +2 -2
- data/lib/thinking_sphinx/callbacks.rb +9 -0
- data/lib/thinking_sphinx/callbacks/appender.rb +59 -0
- data/lib/thinking_sphinx/commands/index_real_time.rb +1 -3
- data/lib/thinking_sphinx/connection.rb +4 -0
- data/lib/thinking_sphinx/connection/client.rb +6 -1
- data/lib/thinking_sphinx/core/index.rb +5 -2
- data/lib/thinking_sphinx/deletion.rb +18 -17
- data/lib/thinking_sphinx/errors.rb +1 -1
- data/lib/thinking_sphinx/index_set.rb +7 -3
- data/lib/thinking_sphinx/middlewares/sphinxql.rb +1 -1
- data/lib/thinking_sphinx/railtie.rb +14 -1
- data/lib/thinking_sphinx/real_time.rb +17 -0
- data/lib/thinking_sphinx/real_time/index.rb +5 -3
- data/lib/thinking_sphinx/real_time/index/template.rb +12 -0
- data/lib/thinking_sphinx/real_time/interpreter.rb +8 -6
- data/lib/thinking_sphinx/real_time/populator.rb +5 -2
- data/lib/thinking_sphinx/real_time/processor.rb +36 -0
- data/lib/thinking_sphinx/real_time/transcriber.rb +41 -19
- data/lib/thinking_sphinx/real_time/translator.rb +1 -0
- data/lib/thinking_sphinx/settings.rb +13 -9
- data/lib/thinking_sphinx/subscribers/populator_subscriber.rb +0 -4
- data/spec/acceptance/big_integers_spec.rb +1 -1
- data/spec/acceptance/geosearching_spec.rb +13 -3
- data/spec/acceptance/merging_spec.rb +1 -1
- data/spec/acceptance/real_time_updates_spec.rb +2 -2
- data/spec/acceptance/sql_deltas_spec.rb +15 -3
- data/spec/acceptance/support/sphinx_helpers.rb +4 -4
- data/spec/acceptance/suspended_deltas_spec.rb +3 -3
- data/spec/internal/app/indices/article_index.rb +0 -1
- data/spec/internal/app/indices/colour_index.rb +7 -0
- data/spec/internal/app/models/admin/person.rb +3 -1
- data/spec/internal/app/models/album.rb +3 -1
- data/spec/internal/app/models/animal.rb +1 -0
- data/spec/internal/app/models/article.rb +2 -0
- data/spec/internal/app/models/bird.rb +1 -0
- data/spec/internal/app/models/book.rb +2 -0
- data/spec/internal/app/models/car.rb +1 -1
- data/spec/internal/app/models/city.rb +2 -0
- data/spec/internal/app/models/colour.rb +2 -0
- data/spec/internal/app/models/product.rb +1 -1
- data/spec/internal/app/models/tee.rb +5 -0
- data/spec/internal/app/models/user.rb +2 -0
- data/spec/internal/config/database.yml +6 -1
- data/spec/internal/db/schema.rb +1 -0
- data/spec/thinking_sphinx/active_record/callbacks/update_callbacks_spec.rb +2 -1
- data/spec/thinking_sphinx/active_record/index_spec.rb +0 -12
- data/spec/thinking_sphinx/active_record/interpreter_spec.rb +15 -14
- data/spec/thinking_sphinx/active_record/sql_source_spec.rb +41 -3
- data/spec/thinking_sphinx/connection/mri_spec.rb +49 -0
- data/spec/thinking_sphinx/deletion_spec.rb +5 -4
- data/spec/thinking_sphinx/index_set_spec.rb +28 -12
- data/spec/thinking_sphinx/middlewares/sphinxql_spec.rb +2 -1
- data/spec/thinking_sphinx/real_time/index_spec.rb +51 -13
- data/spec/thinking_sphinx/real_time/interpreter_spec.rb +14 -14
- data/spec/thinking_sphinx/real_time/transcriber_spec.rb +9 -1
- data/thinking-sphinx.gemspec +3 -5
- metadata +17 -11
- data/spec/acceptance/connection_spec.rb +0 -25
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c14b609439492778ba5139bc3e75ffc17952a803c8d6f0d892eb76b7587da4cb
|
4
|
+
data.tar.gz: fe3ba9a0b8c1d081960ff9f988e5a8a61e094da07d0dccdf3854f9962af6da26
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6642a48f92ce9b7040e05eb2552a6329492151114468bdf2b82f31f5a6875ba33fda5e190ec0a0220d8a058b69af25057f8ce5beead88ba8351aa8d63dfbb5c0
|
7
|
+
data.tar.gz: 89b8ee56a4915cd1db7bd761766c56d2586ae575028a0fae2924d73588c312eb9f9505d2d63272e275710d7b6be4f81c63445d0a320363bcb098d3f4686913ef
|
@@ -0,0 +1,152 @@
|
|
1
|
+
version: 2.1
|
2
|
+
|
3
|
+
orbs:
|
4
|
+
ruby: circleci/ruby@1.0
|
5
|
+
|
6
|
+
workflows:
|
7
|
+
test:
|
8
|
+
jobs:
|
9
|
+
- test:
|
10
|
+
name: "Sphinx 2.2.11 with MySQL"
|
11
|
+
database: mysql2
|
12
|
+
sphinx_version: 2.2.11
|
13
|
+
sphinx_engine: sphinx
|
14
|
+
debian: jessie
|
15
|
+
ruby: '2.4.6'
|
16
|
+
- test:
|
17
|
+
name: "Sphinx 2.2.11 with PostgreSQL"
|
18
|
+
database: postgresql
|
19
|
+
sphinx_version: 2.2.11
|
20
|
+
sphinx_engine: sphinx
|
21
|
+
debian: jessie
|
22
|
+
ruby: '2.4.6'
|
23
|
+
- test:
|
24
|
+
name: "Sphinx 3.3.1 with MySQL"
|
25
|
+
database: mysql2
|
26
|
+
sphinx_version: 3.3.1
|
27
|
+
sphinx_engine: sphinx
|
28
|
+
debian: buster
|
29
|
+
matrix:
|
30
|
+
parameters:
|
31
|
+
ruby: [ '2.4.9', '2.5.8', '2.6.6', '2.7.2', '3.0.0' ]
|
32
|
+
# - test:
|
33
|
+
# database: postgresql
|
34
|
+
# sphinx_version: 3.3.1
|
35
|
+
# sphinx_engine: sphinx
|
36
|
+
# matrix:
|
37
|
+
# parameters:
|
38
|
+
# ruby: [ '2.4', '2.5', '2.6', '2.7' ]
|
39
|
+
- test:
|
40
|
+
name: "Manticore 2.8.2 with MySQL"
|
41
|
+
database: mysql2
|
42
|
+
sphinx_version: 2.8.2
|
43
|
+
sphinx_engine: manticore
|
44
|
+
debian: stretch
|
45
|
+
matrix:
|
46
|
+
parameters:
|
47
|
+
ruby: [ '2.4.9', '2.5.8', '2.6.6' ]
|
48
|
+
- test:
|
49
|
+
name: "Manticore 2.8.2 with PostgreSQL"
|
50
|
+
database: postgresql
|
51
|
+
sphinx_version: 2.8.2
|
52
|
+
sphinx_engine: manticore
|
53
|
+
debian: stretch
|
54
|
+
matrix:
|
55
|
+
parameters:
|
56
|
+
ruby: [ '2.4.9', '2.5.8', '2.6.6' ]
|
57
|
+
- test:
|
58
|
+
name: "Manticore 3.5.4 with MySQL"
|
59
|
+
database: mysql2
|
60
|
+
sphinx_version: 3.5.4
|
61
|
+
sphinx_engine: manticore
|
62
|
+
debian: buster
|
63
|
+
matrix:
|
64
|
+
parameters:
|
65
|
+
ruby: [ '2.4.9', '2.5.8', '2.6.6', '2.7.2', '3.0.0' ]
|
66
|
+
- test:
|
67
|
+
name: "Manticore 3.5.4 with PostgreSQL"
|
68
|
+
database: postgresql
|
69
|
+
sphinx_version: 3.5.4
|
70
|
+
sphinx_engine: manticore
|
71
|
+
debian: buster
|
72
|
+
matrix:
|
73
|
+
parameters:
|
74
|
+
ruby: [ '2.4.9', '2.5.8', '2.6.6', '2.7.2', '3.0.0' ]
|
75
|
+
|
76
|
+
jobs:
|
77
|
+
test:
|
78
|
+
parameters:
|
79
|
+
ruby:
|
80
|
+
type: string
|
81
|
+
database:
|
82
|
+
type: string
|
83
|
+
sphinx_version:
|
84
|
+
type: string
|
85
|
+
sphinx_engine:
|
86
|
+
type: string
|
87
|
+
debian:
|
88
|
+
type: string
|
89
|
+
|
90
|
+
docker:
|
91
|
+
- image: circleci/ruby:<< parameters.ruby >>-<< parameters.debian >>
|
92
|
+
|
93
|
+
- image: circleci/postgres:10
|
94
|
+
environment:
|
95
|
+
POSTGRES_USER: postgres
|
96
|
+
POSTGRES_PASSWORD: thinking_sphinx
|
97
|
+
POSTGRES_DB: thinking_sphinx
|
98
|
+
|
99
|
+
- image: circleci/mysql:5.7
|
100
|
+
environment:
|
101
|
+
MYSQL_ROOT_PASSWORD: thinking_sphinx
|
102
|
+
MYSQL_DATABASE: thinking_sphinx
|
103
|
+
|
104
|
+
working_directory: ~/app
|
105
|
+
|
106
|
+
steps:
|
107
|
+
- checkout
|
108
|
+
|
109
|
+
- restore_cache:
|
110
|
+
keys:
|
111
|
+
- v1-dependencies-<< parameters.ruby >>
|
112
|
+
|
113
|
+
- run:
|
114
|
+
name: install bundler
|
115
|
+
command: |
|
116
|
+
if [ "<< parameters.ruby >>" == "2.7.2" ]; then
|
117
|
+
export BUNDLER_VERSION=2.1.4
|
118
|
+
elif [ "<< parameters.ruby >>" == "3.0.0" ]; then
|
119
|
+
export BUNDLER_VERSION=2.1.4
|
120
|
+
else
|
121
|
+
export BUNDLER_VERSION=1.17.3
|
122
|
+
fi
|
123
|
+
export BUNDLE_PATH=vendor/bundle
|
124
|
+
gem install bundler:$BUNDLER_VERSION
|
125
|
+
|
126
|
+
- run:
|
127
|
+
name: install dependencies
|
128
|
+
command: |
|
129
|
+
bundle install --jobs=4 --retry=3 --path vendor/bundle
|
130
|
+
bundle update
|
131
|
+
|
132
|
+
- run:
|
133
|
+
name: set up appraisal
|
134
|
+
command: bundle exec appraisal update
|
135
|
+
|
136
|
+
- save_cache:
|
137
|
+
paths:
|
138
|
+
- ./vendor/bundle
|
139
|
+
key: v1-dependencies-<< parameters.ruby >>
|
140
|
+
|
141
|
+
- run:
|
142
|
+
name: set up sphinx
|
143
|
+
command: "./bin/loadsphinx << parameters.sphinx_version >> << parameters.sphinx_engine >>"
|
144
|
+
|
145
|
+
- run:
|
146
|
+
name: tests
|
147
|
+
environment:
|
148
|
+
CI: "true"
|
149
|
+
DATABASE: << parameters.database >>
|
150
|
+
SPHINX_VERSION: << parameters.sphinx_version >>
|
151
|
+
SPHINX_ENGINE: << parameters.sphinx_engine >>
|
152
|
+
command: bundle exec appraisal rspec
|
data/.travis.yml
CHANGED
@@ -1,41 +1,36 @@
|
|
1
1
|
language: ruby
|
2
|
+
dist: xenial
|
2
3
|
rvm:
|
3
|
-
- 2.
|
4
|
-
- 2.
|
5
|
-
- 2.
|
6
|
-
- 2.
|
4
|
+
- 2.4.10
|
5
|
+
- 2.5.8
|
6
|
+
- 2.6.6
|
7
|
+
- 2.7.1
|
7
8
|
before_install:
|
8
|
-
- pip install --upgrade --user awscli
|
9
9
|
- gem update --system
|
10
|
-
- gem
|
11
|
-
|
10
|
+
- gem install bundler -v '1.17.3'
|
11
|
+
install: bundle _1.17.3_ install --jobs=3 --retry=3
|
12
12
|
before_script:
|
13
13
|
- mysql -e 'create database thinking_sphinx;' > /dev/null
|
14
14
|
- psql -c 'create database thinking_sphinx;' -U postgres >/dev/null
|
15
15
|
- "./bin/loadsphinx $SPHINX_VERSION $SPHINX_ENGINE"
|
16
|
-
- bundle exec appraisal install
|
17
|
-
script: bundle exec appraisal rspec
|
16
|
+
- bundle _1.17.3_ exec appraisal install
|
17
|
+
script: bundle _1.17.3_ exec appraisal rspec
|
18
18
|
env:
|
19
|
-
global:
|
20
|
-
- secure: cUPinkilBafqDSPsTkl/PXYc2aXNKUQKXGK8poBBMqKN9/wjfJx1DWgtowDKalekdZELxDhc85Ye3bL1xlW4nLjOu+U6Tkt8eNw2Nhs1flodHzA/RyENdBLr/tBHt43EjkrDehZx5sBHmWQY4miHs8AJz0oKO9Ae2inTOHx9Iuc=
|
21
19
|
matrix:
|
22
|
-
- DATABASE=mysql2 SPHINX_VERSION=2.1.9 SPHINX_ENGINE=sphinx
|
23
|
-
- DATABASE=postgresql SPHINX_VERSION=2.1.9 SPHINX_ENGINE=sphinx
|
24
20
|
- DATABASE=mysql2 SPHINX_VERSION=2.2.11 SPHINX_ENGINE=sphinx
|
25
21
|
- DATABASE=postgresql SPHINX_VERSION=2.2.11 SPHINX_ENGINE=sphinx
|
26
|
-
- DATABASE=mysql2 SPHINX_VERSION=3.
|
27
|
-
- DATABASE=postgresql SPHINX_VERSION=3.0.3 SPHINX_ENGINE=sphinx
|
28
|
-
- DATABASE=mysql2 SPHINX_VERSION=3.1.1 SPHINX_ENGINE=sphinx
|
29
|
-
- DATABASE=mysql2 SPHINX_VERSION=2.6.4 SPHINX_ENGINE=manticore
|
30
|
-
- DATABASE=postgresql SPHINX_VERSION=2.6.4 SPHINX_ENGINE=manticore
|
31
|
-
- DATABASE=mysql2 SPHINX_VERSION=2.7.5 SPHINX_ENGINE=manticore
|
32
|
-
- DATABASE=postgresql SPHINX_VERSION=2.7.5 SPHINX_ENGINE=manticore
|
22
|
+
- DATABASE=mysql2 SPHINX_VERSION=3.3.1 SPHINX_ENGINE=sphinx
|
33
23
|
- DATABASE=mysql2 SPHINX_VERSION=2.8.2 SPHINX_ENGINE=manticore
|
34
24
|
- DATABASE=postgresql SPHINX_VERSION=2.8.2 SPHINX_ENGINE=manticore
|
35
|
-
|
25
|
+
- DATABASE=mysql2 SPHINX_VERSION=3.5.0 SPHINX_ENGINE=manticore
|
26
|
+
- DATABASE=postgresql SPHINX_VERSION=3.5.0 SPHINX_ENGINE=manticore
|
27
|
+
# - DATABASE=postgresql SPHINX_VERSION=3.3.1 SPHINX_ENGINE=sphinx
|
36
28
|
sudo: false
|
37
29
|
addons:
|
38
30
|
postgresql: '9.4'
|
31
|
+
apt:
|
32
|
+
packages:
|
33
|
+
- libodbc1
|
39
34
|
services:
|
40
35
|
- mysql
|
41
36
|
- postgresql
|
data/Appraisals
CHANGED
@@ -1,22 +1,7 @@
|
|
1
|
-
appraise 'rails_3_2' do
|
2
|
-
gem 'rails', '~> 3.2.22.2'
|
3
|
-
gem 'mysql2', '~> 0.3.10', :platform => :ruby
|
4
|
-
end if RUBY_VERSION.to_f <= 2.3
|
5
|
-
|
6
|
-
appraise 'rails_4_0' do
|
7
|
-
gem 'rails', '~> 4.0.13'
|
8
|
-
gem 'mysql2', '~> 0.3.10', :platform => :ruby
|
9
|
-
end if RUBY_VERSION.to_f <= 2.3
|
10
|
-
|
11
|
-
appraise 'rails_4_1' do
|
12
|
-
gem 'rails', '~> 4.1.15'
|
13
|
-
gem 'mysql2', '~> 0.3.13', :platform => :ruby
|
14
|
-
end if RUBY_VERSION.to_f <= 2.3
|
15
|
-
|
16
1
|
appraise 'rails_4_2' do
|
17
2
|
gem 'rails', '~> 4.2.6'
|
18
3
|
gem 'mysql2', '~> 0.4.0', :platform => :ruby
|
19
|
-
end if RUBY_VERSION.to_f <= 2.
|
4
|
+
end if RUBY_VERSION.to_f <= 2.4
|
20
5
|
|
21
6
|
appraise 'rails_5_0' do
|
22
7
|
if RUBY_PLATFORM == "java"
|
@@ -30,21 +15,27 @@ appraise 'rails_5_0' do
|
|
30
15
|
gem 'jdbc-mysql', '~> 5.1.36', :platform => :jruby
|
31
16
|
gem 'activerecord-jdbcmysql-adapter', '~> 50.0', :platform => :jruby
|
32
17
|
gem 'activerecord-jdbcpostgresql-adapter', '~> 50.0', :platform => :jruby
|
33
|
-
end if RUBY_PLATFORM != "java" || ENV["SPHINX_VERSION"].to_f > 2.1
|
18
|
+
end if (RUBY_PLATFORM != "java" || ENV["SPHINX_VERSION"].to_f > 2.1) && RUBY_VERSION.to_f < 3.0
|
34
19
|
|
35
20
|
appraise 'rails_5_1' do
|
36
21
|
gem 'rails', '~> 5.1.0'
|
37
22
|
gem 'mysql2', '~> 0.4.0', :platform => :ruby
|
38
|
-
end if RUBY_PLATFORM != 'java'
|
23
|
+
end if RUBY_PLATFORM != 'java' && RUBY_VERSION.to_f < 3.0
|
39
24
|
|
40
25
|
appraise 'rails_5_2' do
|
41
26
|
gem 'rails', '~> 5.2.0'
|
42
27
|
gem 'mysql2', '~> 0.5.0', :platform => :ruby
|
43
28
|
gem 'pg', '~> 1.0', :platform => :ruby
|
44
|
-
end if RUBY_PLATFORM != 'java'
|
29
|
+
end if RUBY_PLATFORM != 'java' && RUBY_VERSION.to_f < 3.0
|
45
30
|
|
46
31
|
appraise 'rails_6_0' do
|
47
|
-
gem 'rails', '~> 6.0.0
|
32
|
+
gem 'rails', '~> 6.0.0'
|
33
|
+
gem 'mysql2', '~> 0.5.0', :platform => :ruby
|
34
|
+
gem 'pg', '~> 1.0', :platform => :ruby
|
35
|
+
end if RUBY_PLATFORM != 'java' && RUBY_VERSION.to_f >= 2.5
|
36
|
+
|
37
|
+
appraise 'rails_6_1' do
|
38
|
+
gem 'rails', '~> 6.1.0'
|
48
39
|
gem 'mysql2', '~> 0.5.0', :platform => :ruby
|
49
40
|
gem 'pg', '~> 1.0', :platform => :ruby
|
50
41
|
end if RUBY_PLATFORM != 'java' && RUBY_VERSION.to_f >= 2.5
|
data/CHANGELOG.markdown
CHANGED
@@ -2,6 +2,85 @@
|
|
2
2
|
|
3
3
|
All notable changes to this project (at least, from v3.0.0 onwards) are documented in this file.
|
4
4
|
|
5
|
+
## 5.2.0 - 2021-06-12
|
6
|
+
|
7
|
+
[Release Notes](https://github.com/pat/thinking-sphinx/releases/tag/v5.2.0)
|
8
|
+
|
9
|
+
### Added
|
10
|
+
|
11
|
+
* Confirmed support for Ruby 3.0.
|
12
|
+
* Orphaned records in real-time indices can now be cleaned up without running `rails ts:rebuild`. Disabled by default, can be enabled by setting `real_time_tidy` to true per environment in `config/thinking_sphinx.yml` (and will need `ts:rebuild` to restructure indices upon initial deploy). More details in [#1192](https://github.com/pat/thinking-sphinx/pull/1192).
|
13
|
+
|
14
|
+
### Fixed
|
15
|
+
|
16
|
+
* Avoid loading ActiveRecord during Rails initialisation so app configuration can still have an impact ([@jdelStrother](https://github.com/jdelStrother) in [#1194](https://github.com/pat/thinking-sphinx/pull/1194)).
|
17
|
+
* Remove `app/indices` (in both the Rails app and engines) from Rails' eager load paths, which was otherwise leading to indices being loaded more than once. (See [#1191](https://github.com/pat/thinking-sphinx/issues/1191) and [#1195](https://github.com/pat/thinking-sphinx/issues/1195)).
|
18
|
+
|
19
|
+
## 5.1.0 - 2020-12-28
|
20
|
+
|
21
|
+
[Release Notes](https://github.com/pat/thinking-sphinx/releases/tag/v5.1.0)
|
22
|
+
|
23
|
+
### Added
|
24
|
+
|
25
|
+
* Support for Sphinx v3.3 and Manticore v3.5.
|
26
|
+
* Support for Rails 6.1 (via [joiner](https://rubygems.org/gems/joiner) v0.6.0).
|
27
|
+
|
28
|
+
### Changed
|
29
|
+
|
30
|
+
* `enable_star` is no longer available as a configuration option, as it's been enabled by default in Sphinx since v2.2.2, and is no longer allowed in Sphinx v3.3.1.
|
31
|
+
* All timestamp attributes are now considered plain integer values from Sphinx's perspective. Sphinx was already expecting integers, but since Sphinx v3.3.1 it doesn't recognise timestamps as a data type. There is no functional difference with this change - Thinking Sphinx was always converting times to their UNIX epoch integer values.
|
32
|
+
* Allow configuration of the maximum statement length ([@kalsan](https://github.com/kalsan) in [#1179](https://github.com/pat/thinking-sphinx/pull/1179)).
|
33
|
+
* Respect `:path` values to navigate associations for Thinking Sphinx callbacks on SQL-backed indices. Discussed in [#1182](https://github.com/pat/thinking-sphinx/issues/1182).
|
34
|
+
|
35
|
+
### Fixed
|
36
|
+
|
37
|
+
* Don't attempt to update delta flags on frozen model instances.
|
38
|
+
|
39
|
+
## 5.0.0 - 2020-07-20
|
40
|
+
|
41
|
+
[Release Notes](https://github.com/pat/thinking-sphinx/releases/tag/v5.0.0)
|
42
|
+
|
43
|
+
### Added
|
44
|
+
|
45
|
+
* New interface for adding callbacks to indexed models (which is no longer done automatically). Discussed in [#1173](https://github.com/pat/thinking-sphinx/issues/1173) and committed via [#1175](https://github.com/pat/thinking-sphinx/pull/1175). **This is a breaking change - you will need to add these callbacks. See [the full release notes](https://github.com/pat/thinking-sphinx/releases/tag/v5.0.0) for examples.**
|
46
|
+
* Fields and attributes can be overriden - whichever's defined last with a given name is the definition that's used. This is an edge case, but useful if you want to override any of the default fields/indices. (Requested by @kalsan in [#1172](https://github.com/pat/thinking-sphinx/issues/1172).)
|
47
|
+
* Custom index_set_class implementations can now expect the `:instances` option to be set alongside `:classes`, which is useful in cases to limit the indices returned if you're splitting index data for given classes/models into shards. (Introduced in PR [#1171](https://github.com/pat/thinking-sphinx/pull/1171) after discussions with @lunaru in [#1166](https://github.com/pat/thinking-sphinx/issues/1166).)
|
48
|
+
|
49
|
+
### Changed
|
50
|
+
|
51
|
+
* Sphinx 2.2.11 or newer is required, or Manticore 2.8.2 or newer.
|
52
|
+
* Ruby 2.4 or newer is required.
|
53
|
+
* Rails 4.2 or newer is required.
|
54
|
+
* Remove internal uses of `send`, replaced with `public_send` as that's available in all supported Ruby versions.
|
55
|
+
* Deletion statements are simplified by avoiding the need to calculate document keys/offsets (@njakobsen via [#1134](https://github.com/pat/thinking-sphinx/issues/1134)).
|
56
|
+
* Real-time data is deleted before replacing it, to avoid duplicate data when offsets change (@njakobsen via [#1134](https://github.com/pat/thinking-sphinx/issues/1134)).
|
57
|
+
* Use `reference_name` as per custom `index_set_class` definitions. Previously, the class method was called on `ThinkingSphinx::IndexSet` even if a custom subclass was configured. (As per discussions with @kalsan in [#1172](https://github.com/pat/thinking-sphinx/issues/1172).)
|
58
|
+
|
59
|
+
## 4.4.1 - 2019-08-23
|
60
|
+
|
61
|
+
[Release Notes](https://github.com/pat/thinking-sphinx/releases/tag/v4.4.1)
|
62
|
+
|
63
|
+
### Changed
|
64
|
+
|
65
|
+
* Automatically remove `app/indices` from Zeitwerk's autoload paths in Rails 6.0 onwards (if using Zeitwerk as the autoloader).
|
66
|
+
|
67
|
+
## 4.4.0 - 2019-08-21
|
68
|
+
|
69
|
+
[Release Notes](https://github.com/pat/thinking-sphinx/releases/tag/v4.4.0)
|
70
|
+
|
71
|
+
### Added
|
72
|
+
|
73
|
+
* Confirmed Rails 6.0 support.
|
74
|
+
* Added ability to have custom real-time index processors (which handles all indices) and populators (which handles a particular index). These are available to get/set via `ThinkingSphinx::RealTime.processor` and `ThinkingSphinx::RealTime.populator` (and discussed in more detail in the [release notes](https://github.com/pat/thinking-sphinx/releases/tag/v4.4.0)).
|
75
|
+
|
76
|
+
### Changed
|
77
|
+
|
78
|
+
* Improve failure message when tables don't exist for models associated with Sphinx indices ([Kiril Mitov](https://github.com/thebravoman) in [#1139](https://github.com/pat/thinking-sphinx/pull/1139)).
|
79
|
+
|
80
|
+
### Fixed
|
81
|
+
|
82
|
+
* Injected has-many/habtm collection search calls as default extensions to associations in Rails 5+, as it's a more reliable approach in Rails 6.0.0.
|
83
|
+
|
5
84
|
## 4.3.2 - 2019-07-10
|
6
85
|
|
7
86
|
[Release Notes](https://github.com/pat/thinking-sphinx/releases/tag/v4.3.2)
|
data/README.textile
CHANGED
@@ -1,22 +1,22 @@
|
|
1
1
|
h1. Thinking Sphinx
|
2
2
|
|
3
|
-
Thinking Sphinx is a library for connecting ActiveRecord to the Sphinx full-text search tool, and integrates closely with Rails (but also works with other Ruby web frameworks). The current release is
|
3
|
+
Thinking Sphinx is a library for connecting ActiveRecord to the Sphinx full-text search tool, and integrates closely with Rails (but also works with other Ruby web frameworks). The current release is v5.2.0.
|
4
4
|
|
5
5
|
h2. Upgrading
|
6
6
|
|
7
7
|
Please refer to "the changelog":https://github.com/pat/thinking-sphinx/blob/develop/CHANGELOG.markdown and "release notes":https://github.com/pat/thinking-sphinx/releases for any changes you need to make when upgrading. The release notes in particular are quite good at covering breaking changes and more details for new features.
|
8
8
|
|
9
|
-
The documentation also has more details on what's involved for upgrading from "v3 to v4":https://freelancing-gods.com/thinking-sphinx/v4/upgrading.html, and "v1/v2 to v3":https://freelancing-gods.com/thinking-sphinx/v3/upgrading.html.
|
9
|
+
The documentation also has more details on what's involved for upgrading from "v4 to v5":https://freelancing-gods.com/thinking-sphinx/v5/upgrading.html, "v3 to v4":https://freelancing-gods.com/thinking-sphinx/v4/upgrading.html, and "v1/v2 to v3":https://freelancing-gods.com/thinking-sphinx/v3/upgrading.html.
|
10
10
|
|
11
11
|
h2. Installation
|
12
12
|
|
13
13
|
It's a gem, so install it like you would any other gem. You will also need to specify the mysql2 gem if you're using MRI, or jdbc-mysql if you're using JRuby:
|
14
14
|
|
15
|
-
<pre><code>gem 'mysql2', '~> 0.
|
15
|
+
<pre><code>gem 'mysql2', '~> 0.4', :platform => :ruby
|
16
16
|
gem 'jdbc-mysql', '~> 5.1.35', :platform => :jruby
|
17
|
-
gem 'thinking-sphinx', '~>
|
17
|
+
gem 'thinking-sphinx', '~> 5.2'</code></pre>
|
18
18
|
|
19
|
-
The MySQL gems mentioned are required for connecting to Sphinx, so please include it even when you're using PostgreSQL for your database.
|
19
|
+
The MySQL gems mentioned are required for connecting to Sphinx, so please include it even when you're using PostgreSQL for your database.
|
20
20
|
|
21
21
|
You'll also need to install Sphinx - this is covered in "the extended documentation":https://freelancing-gods.com/thinking-sphinx/installing_sphinx.html.
|
22
22
|
|
@@ -29,30 +29,28 @@ h2. Requirements
|
|
29
29
|
The current release of Thinking Sphinx works with the following versions of its dependencies:
|
30
30
|
|
31
31
|
|_. Library |_. Minimum |_. Tested Against |
|
32
|
-
| Ruby | v2.
|
33
|
-
| Sphinx | v2.
|
34
|
-
| Manticore | v2.
|
35
|
-
| ActiveRecord |
|
32
|
+
| Ruby | v2.4 | v2.4, v2.5, v2.6, v2.7, v3.0 |
|
33
|
+
| Sphinx | v2.2.11 | v2.2.11, v3.3.1 |
|
34
|
+
| Manticore | v2.8 | v2.8, v3.5 |
|
35
|
+
| ActiveRecord | v4.2 | v4.2..v6.1 |
|
36
36
|
|
37
37
|
It _might_ work with older versions of Ruby, but it's highly recommended to update to a supported release.
|
38
38
|
|
39
|
-
It should also work with JRuby, but the test environment
|
39
|
+
It should also work with JRuby, but the test environment for that in CI has been unreliable, hence that's not actively tested against at the moment.
|
40
40
|
|
41
41
|
h3. Sphinx or Manticore
|
42
42
|
|
43
|
-
Thinking Sphinx
|
43
|
+
Thinking Sphinx is currently built for Sphinx 2.2.11 or newer, or Manticore v2.8+.
|
44
44
|
|
45
45
|
h3. Rails and ActiveRecord
|
46
46
|
|
47
|
-
Currently Thinking Sphinx
|
47
|
+
Currently Thinking Sphinx is built to support Rails/ActiveRecord 4.2 or newer. If you're using Sinatra and ActiveRecord instead of Rails, that's fine - just make sure you add the @:require => 'thinking_sphinx/sinatra'@ option when listing @thinking-sphinx@ in your Gemfile.
|
48
48
|
|
49
|
-
|
50
|
-
|
51
|
-
If you want ActiveRecord 3.1 support, then refer to the 3.0.x releases of Thinking Sphinx. Anything older than that, then you're stuck with Thinking Sphinx v2.x (for Rails/ActiveRecord 3.0) or v1.x (Rails 2.3). Please note that these older versions are no longer actively supported.
|
49
|
+
If you want ActiveRecord 3.2-4.1 support, then refer to the 4.x releases of Thinking Sphinx. Or, for ActiveRecord 3.1 support, then refer to the 3.0.x releases. Anything older than that, then you're stuck with Thinking Sphinx v2.x (for Rails/ActiveRecord 3.0) or v1.x (Rails 2.3). Please note that these older versions are no longer actively supported.
|
52
50
|
|
53
51
|
h3. Ruby
|
54
52
|
|
55
|
-
You'll need either the standard Ruby (v2.
|
53
|
+
You'll need either the standard Ruby (v2.4 or newer) or JRuby (9.1 or newer).
|
56
54
|
|
57
55
|
h3. Database Versions
|
58
56
|
|
@@ -81,4 +79,4 @@ You can then run the unit tests with @rake spec:unit@, the acceptance tests with
|
|
81
79
|
|
82
80
|
h2. Licence
|
83
81
|
|
84
|
-
Copyright (c) 2007-
|
82
|
+
Copyright (c) 2007-2020, Thinking Sphinx is developed and maintained by Pat Allan, and is released under the open MIT Licence. Many thanks to "all who have contributed patches":https://github.com/pat/thinking-sphinx/contributors.
|
data/bin/loadsphinx
CHANGED
@@ -3,13 +3,18 @@
|
|
3
3
|
version=$1
|
4
4
|
engine=$2
|
5
5
|
|
6
|
+
set -e
|
7
|
+
|
6
8
|
load_sphinx () {
|
9
|
+
distro="xenial"
|
10
|
+
|
7
11
|
case $version in
|
8
12
|
2.1.9)
|
9
13
|
url="http://sphinxsearch.com/files/sphinxsearch_2.1.9-release-0ubuntu11~trusty_amd64.deb"
|
10
|
-
format="deb"
|
14
|
+
format="deb"
|
15
|
+
distro="trusty";;
|
11
16
|
2.2.11)
|
12
|
-
url="http://sphinxsearch.com/files/sphinxsearch_2.2.11-release-1~
|
17
|
+
url="http://sphinxsearch.com/files/sphinxsearch_2.2.11-release-1~jessie_amd64.deb"
|
13
18
|
format="deb";;
|
14
19
|
3.0.3)
|
15
20
|
url="http://sphinxsearch.com/files/sphinx-3.0.3-facc3fb-linux-amd64.tar.gz"
|
@@ -17,14 +22,27 @@ load_sphinx () {
|
|
17
22
|
3.1.1)
|
18
23
|
url="http://sphinxsearch.com/files/sphinx-3.1.1-612d99f-linux-amd64.tar.gz"
|
19
24
|
format="gz";;
|
25
|
+
3.2.1)
|
26
|
+
url="http://sphinxsearch.com/files/sphinx-3.2.1-f152e0b-linux-amd64.tar.gz"
|
27
|
+
format="gz";;
|
28
|
+
3.3.1)
|
29
|
+
url="http://sphinxsearch.com/files/sphinx-3.3.1-b72d67b-linux-amd64.tar.gz"
|
30
|
+
format="gz";;
|
20
31
|
*)
|
21
32
|
echo "No Sphinx version $version available"
|
22
33
|
exit 1;;
|
23
34
|
esac
|
24
35
|
|
36
|
+
if [ "$distro" == "trusty" ]; then
|
37
|
+
curl --location http://launchpadlibrarian.net/247512886/libmysqlclient18_5.6.28-1ubuntu3_amd64.deb -o libmysql.deb
|
38
|
+
sudo apt-get install ./libmysql.deb
|
39
|
+
fi
|
40
|
+
|
25
41
|
if [ "$format" == "deb" ]; then
|
26
42
|
curl --location $url -o sphinx.deb
|
27
|
-
sudo apt-get install
|
43
|
+
sudo apt-get install libodbc1
|
44
|
+
sudo dpkg -i ./sphinx.deb
|
45
|
+
sudo apt-get install -f
|
28
46
|
else
|
29
47
|
curl $url -o sphinx.tar.gz
|
30
48
|
tar -zxvf sphinx.tar.gz
|
@@ -37,18 +55,23 @@ load_manticore () {
|
|
37
55
|
|
38
56
|
case $version in
|
39
57
|
2.6.4)
|
40
|
-
url="https://github.com/manticoresoftware/manticoresearch/releases/download/2.6.4/manticore_2.6.4-180503-37308c3-release-stemmer.
|
58
|
+
url="https://github.com/manticoresoftware/manticoresearch/releases/download/2.6.4/manticore_2.6.4-180503-37308c3-release-stemmer.xenial_amd64-bin.deb";;
|
41
59
|
2.7.5)
|
42
|
-
url="https://github.com/manticoresoftware/manticoresearch/releases/download/2.7.5/manticore_2.7.5-181204-
|
60
|
+
url="https://github.com/manticoresoftware/manticoresearch/releases/download/2.7.5/manticore_2.7.5-181204-4a31c54-release-stemmer.xenial_amd64-bin.deb";;
|
43
61
|
2.8.2)
|
44
|
-
url="https://github.com/manticoresoftware/manticoresearch/releases/download/2.8.2/manticore_2.8.2-190402-
|
62
|
+
url="https://github.com/manticoresoftware/manticoresearch/releases/download/2.8.2/manticore_2.8.2-190402-4e81114d-release-stemmer.stretch_amd64-bin.deb";;
|
63
|
+
3.4.2)
|
64
|
+
url="https://github.com/manticoresoftware/manticoresearch/releases/download/3.4.2/manticore_3.4.2-200410-6903305-release.xenial_amd64-bin.deb";;
|
65
|
+
3.5.4)
|
66
|
+
url="https://repo.manticoresearch.com/repository/manticoresearch_buster/pool/m/manticore/manticore_3.5.4-201211-13f8d08d_amd64.deb";;
|
45
67
|
*)
|
46
68
|
echo "No Manticore version $version available"
|
47
69
|
exit 1;;
|
48
70
|
esac
|
49
71
|
|
50
72
|
curl --location $url -o manticore.deb
|
51
|
-
sudo
|
73
|
+
sudo dpkg -i ./manticore.deb
|
74
|
+
sudo apt-get install -f
|
52
75
|
}
|
53
76
|
|
54
77
|
if [ "$engine" == "sphinx" ]; then
|