- Rails 7
- importmap
- elasticsearch
- bulma
The application is designed to create articles with the ability to quickly search, edit articles with version storage, quickly create a new version of an article based on an existing one. You can view and delete versions. The application works with the Russian language and supports localization.
- ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-darwin20]
- Rails 7.0.4
- Elasticsearch Version: 8.5.1
- Postgres pg_ctl (PostgreSQL) 14.5 (Homebrew)
Two ways:
- Download and unzip Elasticsearch
- brew install elasticsearch
The difference between ways
- Current version 8.5.2
- Curent version
% brew info elasticsearch
==> elasticsearch: stable 7.10.2 (bottled)
Distributed search & analytics engine
https://www.elastic.co/products/elasticsearch
Disabled because it is switching to an incompatible license. Check out `opensearch` instead!
Not installed
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/elasticsearch.rb
License: Apache-2.0
% brew install postgress
% git clone [email protected]:sergey-arkhipov/article.git
% cd article
% bundle install
% vim config/database.yml #Postgres connect
% vim vim config/initializers/elasticsearch.rb # Elasticsearch config
% vim Procfile # Configure path to elasticsearch
ELASTIC_PASSWORD and CERT_FINGERPRINT required if elasticseach has been installed by first way or you simply preffered secure connection between app and elastic.
% rails db:setup #Create DB, fill with seeds.rb
Start the elasticsearch test server http://localhost:9250 If you installed an elasticsearch server with SSL and certificate support, create a separate configuration for the test environment with an anonymous user
# conf_test/elasticsearch.yml
cluster.name: test_rails
node.name: test-node
path.data: $ES_HOME/test_data
path.logs: $ES_HOME/logs_test
http.port: 9250
http.host: 0.0.0.0
xpack.security.authc:
anonymous:
username: anonymous
roles: admins
authz_exception: true
# conf_test/roles.yml
admins:
cluster:
- all
indices:
- names: ["*"]
privileges: [all]
% ES_PATH_CONF=./conf_test ./bin/elasticsearch
% ./bin/rails t
% ./bin/rspec --color -f d