README.md in elasticsearch-model-5.1.0 vs README.md in elasticsearch-model-6.0.0.pre
- old
+ new
@@ -319,11 +319,11 @@
Elasticsearch::Model::Response::Response.__send__ :include, Elasticsearch::Model::Response::Pagination::Kaminari
```
#### The Elasticsearch DSL
-In most situation, you'll want to pass the search definition
+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:
```ruby
response = Article.search query: { match: { title: "Fox Dogs" } },
highlight: { fields: { title: {} } }
@@ -423,11 +423,11 @@
Article.__elasticsearch__.create_index! force: true
Article.__elasticsearch__.refresh_index!
```
By default, index name and document type will be inferred from your class name,
-you can set it explicitely, however:
+you can set it explicitly, however:
```ruby
class Article
index_name "articles-#{Rails.env}"
document_type "post"
@@ -532,11 +532,11 @@
logger.debug [operation, "ID: #{record_id}"]
case operation.to_s
when /index/
record = Article.find(record_id)
- Client.index index: 'articles', type: 'article', id: record.id, body: record.as_indexed_json
+ Client.index index: 'articles', type: 'article', id: record.id, body: record.__elasticsearch__.as_indexed_json
when /delete/
Client.delete index: 'articles', type: 'article', id: record_id
else raise ArgumentError, "Unknown operation '#{operation}'"
end
end
@@ -672,10 +672,10 @@
# Implement the interface for fetching records
#
module Records
def records
- klass.all(id: @ids)
+ klass.all(id: ids)
end
# ...
end
end