Skip to content

Commit fdeac4b

Browse files
committed
Update README, remove Virtus (unmaintained)
1 parent 8628e73 commit fdeac4b

File tree

4 files changed

+33
-54
lines changed

4 files changed

+33
-54
lines changed

README.md

+19-25
Original file line numberDiff line numberDiff line change
@@ -17,28 +17,6 @@ This repository contains various Ruby and Rails integrations for [Elasticsearch]
1717
Elasticsearch client and Ruby API is provided by the
1818
**[elasticsearch-ruby](https://github.com/elastic/elasticsearch-ruby)** project.
1919

20-
## Compatibility
21-
22-
The libraries are compatible with Ruby 2.4 and higher.
23-
24-
The version numbers follow the Elasticsearch major versions. The `master` branch is compatible with
25-
the Elasticsearch `master` branch, therefore, with the next major version.
26-
27-
| Rubygem | | Elasticsearch |
28-
|:-------------:|:-:| :-----------: |
29-
| 0.1 || 1.x |
30-
| 2.x || 2.x |
31-
| 5.x || 5.x |
32-
| 6.x || 6.x |
33-
| 7.x || 7.x |
34-
| master || master |
35-
36-
Use a release that matches the major version of Elasticsearch in your stack. Each client version is
37-
backwards compatible with all minor versions of the same major version.
38-
39-
Check out [Elastic product end of life dates](https://www.elastic.co/support/eol)
40-
to learn which releases are still actively supported and tested.
41-
4220
## Installation
4321

4422
Install each library from [Rubygems](https://rubygems.org/gems/elasticsearch):
@@ -53,6 +31,24 @@ gem 'elasticsearch-model', github: 'elastic/elasticsearch-rails', branch: '5.x'
5331
gem 'elasticsearch-rails', github: 'elastic/elasticsearch-rails', branch: '5.x'
5432
```
5533

34+
## Compatibility
35+
36+
The libraries are compatible with Ruby 2.4 and higher.
37+
38+
The version numbers follow the Elasticsearch major versions. The `master` branch is compatible with the latest Elasticsearch stack stable release.
39+
40+
| Rubygem | | Elasticsearch |
41+
|:-------------:|:-:| :-----------: |
42+
| 0.1 || 1.x |
43+
| 2.x || 2.x |
44+
| 5.x || 5.x |
45+
| 6.x || 6.x |
46+
| master || 7.x |
47+
48+
Use a release that matches the major version of Elasticsearch in your stack. Each client version is backwards compatible with all minor versions of the same major version.
49+
50+
Check out [Elastic product end of life dates](https://www.elastic.co/support/eol) to learn which releases are still actively supported and tested.
51+
5652
## Usage
5753

5854
This project is split into three separate gems:
@@ -108,10 +104,8 @@ rails new searchapp --skip --skip-bundle --template https://raw.github.com/elast
108104
Example of using Elasticsearch as a repository for a Ruby domain object:
109105

110106
```ruby
111-
require 'virtus'
112107
class Article
113-
include Virtus.model
114-
attribute :title, String
108+
attr_accessor :title
115109
end
116110

117111
require 'elasticsearch/persistence'

elasticsearch-model/README.md

+11-23
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,22 @@
11
# Elasticsearch::Model
22

3-
The `elasticsearch-model` library builds on top of the
4-
the [`elasticsearch`](https://github.com/elastic/elasticsearch-ruby) library.
3+
The `elasticsearch-model` library builds on top of the the [`elasticsearch`](https://github.com/elastic/elasticsearch-ruby) library.
54

6-
It aims to simplify integration of Ruby classes ("models"), commonly found
7-
e.g. in [Ruby on Rails](http://rubyonrails.org) applications, with the
8-
[Elasticsearch](https://www.elastic.co) search and analytics engine.
5+
It aims to simplify integration of Ruby classes ("models"), commonly found e.g. in [Ruby on Rails](http://rubyonrails.org) applications, with the [Elasticsearch](https://www.elastic.co) search and analytics engine.
96

107
## Compatibility
118

12-
This library is compatible with Ruby 1.9.3 and higher.
9+
This library is compatible with Ruby 2.4 and higher.
1310

14-
The library version numbers follow the Elasticsearch major versions, and the `master` branch
15-
is compatible with the Elasticsearch `master` branch, therefore, with the next major version.
11+
The library version numbers follow the Elasticsearch major versions. The `master` branch is compatible with the latest Elasticsearch stack stable release.
1612

1713
| Rubygem | | Elasticsearch |
1814
|:-------------:|:-:| :-----------: |
1915
| 0.1 || 1.x |
2016
| 2.x || 2.x |
2117
| 5.x || 5.x |
2218
| 6.x || 6.x |
23-
| master || master |
19+
| master || 7.x |
2420

2521
## Installation
2622

@@ -73,9 +69,7 @@ This will extend the model with functionality related to Elasticsearch.
7369

7470
#### Feature Extraction Pattern
7571

76-
Instead of including the `Elasticsearch::Model` module directly in your model,
77-
you can include it in a "concern" or "trait" module, which is quite common pattern in Rails applications,
78-
using e.g. `ActiveSupport::Concern` as the instrumentation:
72+
Instead of including the `Elasticsearch::Model` module directly in your model, you can include it in a "concern" or "trait" module, which is quite common pattern in Rails applications, using e.g. `ActiveSupport::Concern` as the instrumentation:
7973

8074
```ruby
8175
# In: app/models/concerns/searchable.rb
@@ -290,11 +284,8 @@ NOTE: It is _not_ possible to chain other methods on top of the `records` object
290284

291285
#### Pagination
292286

293-
You can implement pagination with the `from` and `size` search parameters. However, search results
294-
can be automatically paginated with the [`kaminari`](http://rubygems.org/gems/kaminari) or
295-
[`will_paginate`](https://github.com/mislav/will_paginate) gems.
296-
(The pagination gems must be added before the Elasticsearch gems in your Gemfile,
297-
or loaded first in your application.)
287+
You can implement pagination with the `from` and `size` search parameters. However, search results can be automatically paginated with the [`kaminari`](http://rubygems.org/gems/kaminari) or [`will_paginate`](https://github.com/mislav/will_paginate) gems.
288+
(The pagination gems must be added before the Elasticsearch gems in your Gemfile, or loaded first in your application.)
298289

299290
If Kaminari or WillPaginate is loaded, use the familiar paging methods:
300291

@@ -322,8 +313,7 @@ Elasticsearch::Model::Response::Response.__send__ :include, Elasticsearch::Model
322313

323314
#### The Elasticsearch DSL
324315

325-
In most situations, you'll want to pass the search definition
326-
in the Elasticsearch [domain-specific language](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl.html) to the client:
316+
In most situations, you'll want to pass the search definition in the Elasticsearch [domain-specific language](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl.html) to the client:
327317

328318
```ruby
329319
response = Article.search query: { match: { title: "Fox Dogs" } },
@@ -333,8 +323,7 @@ response.results.first.highlight.title
333323
# ["Quick brown <em>fox</em>"]
334324
```
335325

336-
You can pass any object which implements a `to_hash` method, which is called automatically,
337-
so you can use a custom class or your favourite JSON builder to build the search definition:
326+
You can pass any object which implements a `to_hash` method, which is called automatically, so you can use a custom class or your favourite JSON builder to build the search definition:
338327

339328
```ruby
340329
require 'jbuilder'
@@ -354,8 +343,7 @@ response.results.first.title
354343
# => "Quick brown fox"
355344
```
356345

357-
Also, you can use the [**`elasticsearch-dsl`**](https://github.com/elastic/elasticsearch-ruby/tree/master/elasticsearch-dsl) library, which provides a specialized Ruby API for
358-
the Elasticsearch Query DSL:
346+
Also, you can use the [**`elasticsearch-dsl`**](https://github.com/elastic/elasticsearch-ruby/tree/master/elasticsearch-dsl) library, which provides a specialized Ruby API for the Elasticsearch Query DSL:
359347

360348
```ruby
361349
require 'elasticsearch/dsl'

elasticsearch-persistence/Gemfile

-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ gem 'elasticsearch-model',
2424
path: File.expand_path('../elasticsearch-model', __dir__),
2525
require: false
2626

27-
gem 'virtus'
28-
2927
group :development, :testing do
3028
gem 'pry-nav'
3129
gem 'rspec'

elasticsearch-persistence/README.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,17 @@ Persistence layer for Ruby domain objects in Elasticsearch, using the Repository
44

55
## Compatibility
66

7-
This library is compatible with Ruby 1.9.3 and higher.
7+
This library is compatible with Ruby 2.4 and higher.
88

9-
The library version numbers follow the Elasticsearch major versions, and the `master` branch
10-
is compatible with the Elasticsearch `master` branch, therefore, with the next major version.
9+
The library version numbers follow the Elasticsearch major versions. The `master` branch is compatible with the latest Elasticsearch stack stable release.
1110

1211
| Rubygem | | Elasticsearch |
1312
|:-------------:|:-:| :-----------: |
1413
| 0.1 || 1.x |
1514
| 2.x || 2.x |
1615
| 5.x || 5.x |
1716
| 6.x || 6.x |
18-
| master || master |
17+
| master || 7.x |
1918

2019
## Installation
2120

0 commit comments

Comments
 (0)