estella 6.0.0 → 7.0.1
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 +4 -2
- data/CHANGELOG.md +9 -0
- data/README.md +2 -3
- data/RELEASING.md +1 -1
- data/estella.gemspec +1 -1
- data/lib/estella/helpers.rb +2 -2
- data/lib/estella/searchable.rb +2 -2
- data/lib/estella/version.rb +1 -1
- data/spec/searchable_spec.rb +1 -3
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a5151c04f19b07be3fdbad365ace53fa98ff3e656ae93c88d0601ecc8fd1025
|
4
|
+
data.tar.gz: 8d98facfdab1abbfa74e204cfa3b9d3b1406d03e0991e410ef19c6264f21a58a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2cfa9184c385690fb88018d7f5ae67fcd8c736f551d2afbf456e9527bb699d4dd66f0d7cf8e94d143386b424630e266b0e805fc24abc1d350a515585ae592ff9
|
7
|
+
data.tar.gz: '084f9ca79e95c59ca88320ede69fc9c78747ca1881c1d98cd98cd784c0d5ab67d31ce47e47e7441168881b8a4e1a47b0bd08600461f3444b0f3b56ab612f3eef'
|
data/.circleci/config.yml
CHANGED
@@ -4,7 +4,9 @@ jobs:
|
|
4
4
|
test:
|
5
5
|
docker:
|
6
6
|
- image: "cimg/ruby:<< parameters.ruby_version >>"
|
7
|
-
- image: elasticsearch:
|
7
|
+
- image: docker.elastic.co/elasticsearch/elasticsearch:7.17.18
|
8
|
+
environment:
|
9
|
+
- discovery.type: single-node
|
8
10
|
parameters:
|
9
11
|
ruby_version:
|
10
12
|
type: string
|
@@ -29,4 +31,4 @@ workflows:
|
|
29
31
|
- test:
|
30
32
|
matrix:
|
31
33
|
parameters:
|
32
|
-
ruby_version: ["
|
34
|
+
ruby_version: ["3.1"]
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,15 @@
|
|
2
2
|
|
3
3
|
### Next Release
|
4
4
|
|
5
|
+
### v7.0.1
|
6
|
+
|
7
|
+
* [#43](https://github.com/artsy/estella/pull/43): chore: docs - [@ovasdi]
|
8
|
+
* [#42](https://github.com/artsy/estella/pull/42): feat: searchable module index_slug supports FriendlyId - [@ovasdi]
|
9
|
+
|
10
|
+
### v7.0.0
|
11
|
+
|
12
|
+
* [#40](https://github.com/artsy/estella/pull/40): compatibility with elasticsearch v7 - [@joeyAghion]
|
13
|
+
|
5
14
|
### v6.0.0
|
6
15
|
|
7
16
|
* [#38](https://github.com/artsy/estella/pull/38): Support Elasticsearch 6.x - [@mzikherman]
|
data/README.md
CHANGED
@@ -1,15 +1,14 @@
|
|
1
1
|
# estella
|
2
2
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/estella.svg)](https://badge.fury.io/rb/estella)
|
4
|
-
[![Build Status](https://
|
5
|
-
[![License Status](https://git.legal/projects/3493/badge.svg)](https://git.legal/projects/3493)
|
4
|
+
[![Build Status](https://dl.circleci.com/status-badge/img/gh/artsy/estella/tree/main.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/gh/artsy/estella/tree/main)
|
6
5
|
[![Coverage Status](https://coveralls.io/repos/github/artsy/estella/badge.svg?branch=main)](https://coveralls.io/github/artsy/estella?branch=main)
|
7
6
|
|
8
7
|
Builds on [elasticsearch-model](https://github.com/elastic/elasticsearch-rails/tree/main/elasticsearch-model) to make your Ruby objects searchable with Elasticsearch. Provides fine-grained control of fields, analysis, filters, weightings and boosts.
|
9
8
|
|
10
9
|
## Compatibility
|
11
10
|
|
12
|
-
This library is compatible with [Elasticsearch 1.5.x, 2.x](https://www.elastic.co/products/elasticsearch) when using versions `2.0.0` and earlier. It is compatible with Elasticsearch
|
11
|
+
This library is compatible with [Elasticsearch 1.5.x, 2.x](https://www.elastic.co/products/elasticsearch) when using versions `2.0.0` and earlier. It is compatible with Elasticsearch 6.x via version `6.0.0`. It is compatible with Elasticsearch 7.x via version `7.0.0` or installing directly from the `main` branch of this repository. It works with many ORM/ODMs, including ActiveRecord and Mongoid.
|
13
12
|
|
14
13
|
## Dependencies
|
15
14
|
|
data/RELEASING.md
CHANGED
@@ -11,7 +11,7 @@ bundle install
|
|
11
11
|
rake
|
12
12
|
```
|
13
13
|
|
14
|
-
Check that the last build succeeded in [
|
14
|
+
Check that the last build succeeded in [Circle CI](https://app.circleci.com/pipelines/github/artsy/estella) for all supported platforms.
|
15
15
|
|
16
16
|
Increment the version, modify [lib/estella/version.rb](lib/estella/version.rb).
|
17
17
|
|
data/estella.gemspec
CHANGED
@@ -16,7 +16,7 @@ Gem::Specification.new do |gem|
|
|
16
16
|
|
17
17
|
gem.add_runtime_dependency 'activemodel'
|
18
18
|
gem.add_runtime_dependency 'activesupport'
|
19
|
-
gem.add_runtime_dependency 'elasticsearch-model', '~>
|
19
|
+
gem.add_runtime_dependency 'elasticsearch-model', '~> 7.0'
|
20
20
|
|
21
21
|
gem.add_development_dependency 'activerecord'
|
22
22
|
gem.add_development_dependency 'pry'
|
data/lib/estella/helpers.rb
CHANGED
@@ -63,7 +63,7 @@ module Estella
|
|
63
63
|
|
64
64
|
def bulk_index(batch_of_ids)
|
65
65
|
create_index! unless index_exists?
|
66
|
-
__elasticsearch__.client.bulk index: index_name,
|
66
|
+
__elasticsearch__.client.bulk index: index_name, body: batch_to_bulk(batch_of_ids)
|
67
67
|
end
|
68
68
|
|
69
69
|
# @return true if the index exists
|
@@ -98,7 +98,7 @@ module Estella
|
|
98
98
|
end
|
99
99
|
|
100
100
|
def es_delete_document(id)
|
101
|
-
__elasticsearch__.client.delete
|
101
|
+
__elasticsearch__.client.delete id: id, index: index_name
|
102
102
|
end
|
103
103
|
end
|
104
104
|
end
|
data/lib/estella/searchable.rb
CHANGED
@@ -57,10 +57,10 @@ module Estella
|
|
57
57
|
end
|
58
58
|
|
59
59
|
module ClassMethods
|
60
|
-
# support for mongoid::slug
|
60
|
+
# support for mongoid::slug and friendly_id (AR slugs)
|
61
61
|
# indexes slug attribute by default
|
62
62
|
def index_slug
|
63
|
-
if
|
63
|
+
if method_defined?(:slug) || method_defined?(:friendly_id)
|
64
64
|
indexed_fields.merge!(slug: { type: :keyword })
|
65
65
|
indexed_json.merge!(slug: :slug)
|
66
66
|
end
|
data/lib/estella/version.rb
CHANGED
data/spec/searchable_spec.rb
CHANGED
@@ -20,8 +20,6 @@ describe Estella::Searchable, type: :model do
|
|
20
20
|
'foo'
|
21
21
|
end
|
22
22
|
|
23
|
-
document_type 'searchable_model'
|
24
|
-
|
25
23
|
searchable do
|
26
24
|
field :title, type: :text, analysis: Estella::Analysis::FULLTEXT_ANALYSIS, factor: 1.0
|
27
25
|
field :keywords, type: :text, analysis: %i[default snowball], factor: 0.5
|
@@ -80,7 +78,7 @@ describe Estella::Searchable, type: :model do
|
|
80
78
|
it 'indexes slug field by default' do
|
81
79
|
SearchableModel.create(title: 'liapunov', slug: 'liapunov')
|
82
80
|
SearchableModel.refresh_index!
|
83
|
-
expect(SearchableModel.mappings.to_hash[:
|
81
|
+
expect(SearchableModel.mappings.to_hash[:properties].key?(:slug)).to eq true
|
84
82
|
end
|
85
83
|
it 'supports boolean filters' do
|
86
84
|
liapunov = SearchableModel.create(title: 'liapunov', published: true)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: estella
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 7.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anil Bawa-Cavia
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2024-09-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activemodel
|
@@ -45,14 +45,14 @@ dependencies:
|
|
45
45
|
requirements:
|
46
46
|
- - "~>"
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
version: '
|
48
|
+
version: '7.0'
|
49
49
|
type: :runtime
|
50
50
|
prerelease: false
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
53
|
- - "~>"
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version: '
|
55
|
+
version: '7.0'
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
57
|
name: activerecord
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
@@ -200,7 +200,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
200
200
|
- !ruby/object:Gem::Version
|
201
201
|
version: '0'
|
202
202
|
requirements: []
|
203
|
-
rubygems_version: 3.
|
203
|
+
rubygems_version: 3.5.14
|
204
204
|
signing_key:
|
205
205
|
specification_version: 4
|
206
206
|
summary: Make your Ruby objects searchable with Elasticsearch.
|