diff --git a/README.md b/README.md index 48f5e6f60..4ef960d00 100644 --- a/README.md +++ b/README.md @@ -86,7 +86,20 @@ Article.import ``` You can generate a simple Ruby on Rails application with a single command -(see the [other available templates](https://github.com/elastic/elasticsearch-rails/tree/master/elasticsearch-rails#rails-application-templates)): +(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: + +```bash + docker run \ + --name elasticsearch-rails-searchapp \ + --publish 9200:9200 \ + --env "discovery.type=single-node" \ + --env "cluster.name=elasticsearch-rails" \ + --env "cluster.routing.allocation.disk.threshold_enabled=false" \ + --rm \ + docker.elastic.co/elasticsearch/elasticsearch-oss:7.6.0 +``` + +Once Elasticsearch is running, you can generate the simple app with this command: ```bash rails new searchapp --skip --skip-bundle --template https://raw.github.com/elasticsearch/elasticsearch-rails/master/elasticsearch-rails/lib/rails/templates/01-basic.rb diff --git a/elasticsearch-rails/README.md b/elasticsearch-rails/README.md index deb781f3c..687d016ae 100644 --- a/elasticsearch-rails/README.md +++ b/elasticsearch-rails/README.md @@ -17,6 +17,7 @@ is compatible with the Elasticsearch `master` branch, therefore, with the next m | 2.x | → | 2.x | | 5.x | → | 5.x | | 6.x | → | 6.x | +| 7.x | → | 7.x | | master | → | master | ## Installation @@ -98,8 +99,8 @@ You should see the duration of the request to Elasticsearch as part of each log ### Rails Application Templates You can generate a fully working example Ruby on Rails application, with an `Article` model and a search form, -to play with (it even downloads _Elasticsearch_ itself, generates the application skeleton and leaves you with -a _Git_ repository to explore the steps and the code) with the +to play with (it generates the application skeleton and leaves you with a _Git_ repository to explore the +steps and the code) with the [`01-basic.rb`](https://github.com/elastic/elasticsearch-rails/blob/master/elasticsearch-rails/lib/rails/templates/01-basic.rb) template: ```bash diff --git a/elasticsearch-rails/lib/rails/templates/01-basic.rb b/elasticsearch-rails/lib/rails/templates/01-basic.rb index 154eb1f90..e7305ecd5 100644 --- a/elasticsearch-rails/lib/rails/templates/01-basic.rb +++ b/elasticsearch-rails/lib/rails/templates/01-basic.rb @@ -44,7 +44,7 @@ # ----- Check for Elasticsearch ------------------------------------------------------------------- -required_elasticsearch_version = '6' +required_elasticsearch_version = '7' docker_command =<<-CMD.gsub(/\s{1,}/, ' ').strip docker run \ @@ -54,7 +54,7 @@ --env "cluster.name=elasticsearch-rails" \ --env "cluster.routing.allocation.disk.threshold_enabled=false" \ --rm \ - docker.elastic.co/elasticsearch/elasticsearch-oss:6.4.0 + docker.elastic.co/elasticsearch/elasticsearch-oss:7.6.0 CMD begin