Skip to content

Commit 5042f3f

Browse files
committedJun 18, 2014
[STORE] Added information about accessing the repository from the model into the README
1 parent 4addcfd commit 5042f3f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
 

‎elasticsearch-persistence/README.md

+11
Original file line numberDiff line numberDiff line change
@@ -583,6 +583,17 @@ puts results.response.aggregations.authors.buckets.each { |b| puts "#{b['key']}
583583
# John : 1
584584
```
585585

586+
#### Accessing the Repository Gateway
587+
588+
The Elasticsearch integration is implemented by embedding the repository object in the model.
589+
You can access it through the `gateway` method:
590+
591+
```ruby
592+
Artist.gateway.client.info
593+
# GET http://localhost:9200/ [status:200, request:0.011s, query:n/a]
594+
# => {"status"=>200, "name"=>"Lightspeed", ...}
595+
```
596+
586597
#### Rails Compatibility
587598

588599
The model instances are fully compatible with Rails' conventions and helpers:

0 commit comments

Comments
 (0)
Please sign in to comment.