README.md in elasticsearch-model-7.0.0.pre vs README.md in elasticsearch-model-7.0.0

- old
+ new

@@ -3,11 +3,11 @@ The `elasticsearch-model` library builds on top of the the [`elasticsearch`](https://github.com/elastic/elasticsearch-ruby) library. It aims to simplify integration of Ruby classes ("models"), commonly found e.g. in [Ruby on Rails](http://rubyonrails.org) applications, with the -[Elasticsearch](http://www.elasticsearch.org) search and analytics engine. +[Elasticsearch](https://www.elastic.co) search and analytics engine. ## Compatibility This library is compatible with Ruby 1.9.3 and higher. @@ -17,10 +17,11 @@ | Rubygem | | Elasticsearch | |:-------------:|:-:| :-----------: | | 0.1 | → | 1.x | | 2.x | → | 2.x | | 5.x | → | 5.x | +| 6.x | → | 6.x | | master | → | master | ## Installation Install the package from [Rubygems](https://rubygems.org): @@ -149,11 +150,11 @@ [`elasticsearch-api`](http://rubydoc.info/gems/elasticsearch-api) library documentation for information about the Ruby client API. ### Importing the data -The first thing you'll want to do is importing your data into the index: +The first thing you'll want to do is import your data into the index: ```ruby Article.import # => 0 ``` @@ -320,11 +321,11 @@ ``` #### The Elasticsearch DSL In most situations, you'll want to pass the search definition -in the Elasticsearch [domain-specific language](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl.html) to the client: +in the Elasticsearch [domain-specific language](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl.html) to the client: ```ruby response = Article.search query: { match: { title: "Fox Dogs" } }, highlight: { fields: { title: {} } } @@ -530,11 +531,11 @@ sidekiq_options queue: 'elasticsearch', retry: false Logger = Sidekiq.logger.level == Logger::DEBUG ? Sidekiq.logger : nil Client = Elasticsearch::Client.new host: 'localhost:9200', logger: Logger - def perform(operation, record_id) + def perform_async(operation, record_id) logger.debug [operation, "ID: #{record_id}"] case operation.to_s when /index/ record = Article.find(record_id) @@ -730,18 +731,13 @@ ### Settings The module provides a common `settings` method to customize various features. -At the moment, the only supported setting is `:inheritance_enabled`, which makes the class receiving the module -respect index names and document types of a super-class, eg. in case you're using "single table inheritance" (STI) -in Rails: +Before version 7.0.0 of the gem, the only supported setting was `:inheritance_enabled`. This setting has been deprecated +and removed. -```ruby -Elasticsearch::Model.settings[:inheritance_enabled] = true -``` - ## Development and Community For local development, clone the repository and run `bundle install`. See `rake -T` for a list of available Rake tasks for running tests, generating documentation, starting a testing cluster, etc. @@ -754,22 +750,36 @@ ```bash curl -# https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.0.0.RC1.tar.gz | tar xz -C tmp/ SERVER=start TEST_CLUSTER_COMMAND=$PWD/tmp/elasticsearch-1.0.0.RC1/bin/elasticsearch bundle exec rake test:all ``` +### Single Table Inheritance support + +Versions < 7.0.0 of this gem supported inheritance-- more specifically, `Single Table Inheritance`. With this feature, +elasticsearch settings (index mappings, etc) on a parent model could be inherited by a child model leading to different +model documents being indexed into the same Elasticsearch index. This feature depended on the ability to set a `type` +for a document in Elasticsearch. The Elasticsearch team has deprecated support for `types`, as is described +[here.](https://www.elastic.co/guide/en/elasticsearch/reference/current/removal-of-types.html) +This gem will also remove support for types and `Single Table Inheritance` in version 7.0 as it enables an anti-pattern. +Please save different model documents in separate indices. If you want to use STI, you can include an artificial +`type` field manually in each document and use it in other operations. + ## License This software is licensed under the Apache 2 license, quoted below. - Copyright (c) 2014 Elasticsearch <http://www.elasticsearch.org> - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. + Licensed to Elasticsearch B.V. under one or more contributor + license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright + ownership. Elasticsearch B.V. licenses this file to you under + the Apache License, Version 2.0 (the "License"); you may + not use this file except in compliance with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License.