Skip to content

Commit 1c3226d

Browse files
committed
Update README for generating app with template
Related: #938
1 parent 80f8590 commit 1c3226d

File tree

3 files changed

+19
-5
lines changed

3 files changed

+19
-5
lines changed

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,20 @@ Article.import
8686
```
8787

8888
You can generate a simple Ruby on Rails application with a single command
89-
(see the [other available templates](https://github.com/elastic/elasticsearch-rails/tree/master/elasticsearch-rails#rails-application-templates)):
89+
(see the [other available templates](https://github.com/elastic/elasticsearch-rails/tree/master/elasticsearch-rails#rails-application-templates)). You'll need to have an Elasticsearch cluster running on your system before generating the app. The easiest way of getting this set up is by running it with Docker with this command:
90+
91+
```bash
92+
docker run \
93+
--name elasticsearch-rails-searchapp \
94+
--publish 9200:9200 \
95+
--env "discovery.type=single-node" \
96+
--env "cluster.name=elasticsearch-rails" \
97+
--env "cluster.routing.allocation.disk.threshold_enabled=false" \
98+
--rm \
99+
docker.elastic.co/elasticsearch/elasticsearch-oss:7.6.0
100+
```
101+
102+
Once Elasticsearch is running, you can generate the simple app with this command:
90103

91104
```bash
92105
rails new searchapp --skip --skip-bundle --template https://raw.github.com/elasticsearch/elasticsearch-rails/master/elasticsearch-rails/lib/rails/templates/01-basic.rb

elasticsearch-rails/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ is compatible with the Elasticsearch `master` branch, therefore, with the next m
1717
| 2.x || 2.x |
1818
| 5.x || 5.x |
1919
| 6.x || 6.x |
20+
| 7.x || 7.x |
2021
| master || master |
2122

2223
## Installation
@@ -98,8 +99,8 @@ You should see the duration of the request to Elasticsearch as part of each log
9899
### Rails Application Templates
99100

100101
You can generate a fully working example Ruby on Rails application, with an `Article` model and a search form,
101-
to play with (it even downloads _Elasticsearch_ itself, generates the application skeleton and leaves you with
102-
a _Git_ repository to explore the steps and the code) with the
102+
to play with (it generates the application skeleton and leaves you with a _Git_ repository to explore the
103+
steps and the code) with the
103104
[`01-basic.rb`](https://github.com/elastic/elasticsearch-rails/blob/master/elasticsearch-rails/lib/rails/templates/01-basic.rb) template:
104105

105106
```bash

elasticsearch-rails/lib/rails/templates/01-basic.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444

4545
# ----- Check for Elasticsearch -------------------------------------------------------------------
4646

47-
required_elasticsearch_version = '6'
47+
required_elasticsearch_version = '7'
4848

4949
docker_command =<<-CMD.gsub(/\s{1,}/, ' ').strip
5050
docker run \
@@ -54,7 +54,7 @@
5454
--env "cluster.name=elasticsearch-rails" \
5555
--env "cluster.routing.allocation.disk.threshold_enabled=false" \
5656
--rm \
57-
docker.elastic.co/elasticsearch/elasticsearch-oss:6.4.0
57+
docker.elastic.co/elasticsearch/elasticsearch-oss:7.6.0
5858
CMD
5959

6060
begin

0 commit comments

Comments
 (0)