diff --git a/.travis.yml b/.travis.yml index 0d575dd..bc91e75 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,11 +34,6 @@ env: - RAILS_CACHE_REDIS_DB=1 - RAILS_CACHE_REDIS_PASSWORD= - - ELASTICSEARCH_HOST=localhost - - ELASTICSEARCH_PORT=9200 - - ELASTICSEARCH_USER=elastic - - ELASTICSEARCH_PASSWORD=changeme - before_install: - wget https://github.com/mozilla/geckodriver/releases/download/v0.23.0/geckodriver-v0.23.0-linux64.tar.gz - sudo tar -xvzf geckodriver* @@ -46,11 +41,6 @@ before_install: - sudo mv geckodriver /usr/local/bin/ - geckodriver --version - - curl -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.5.1-amd64.deb - - sudo dpkg -i --force-confnew elasticsearch-7.5.1-amd64.deb - - sudo chown -R elasticsearch:elasticsearch /etc/default/elasticsearch - - sudo systemctl restart elasticsearch.service - install: script/setup script: bundle exec rake all diff --git a/Gemfile b/Gemfile index 0336e17..3cddc33 100644 --- a/Gemfile +++ b/Gemfile @@ -12,8 +12,6 @@ gem 'bootsnap', '>= 1.4.0', require: false gem 'bootstrap', '~> 4.3.1' gem 'devise', '~> 4.7' gem 'devise-i18n', '~> 1.8' -gem 'elasticsearch-model', '~> 7.0' -gem 'elasticsearch-rails', '~> 7.0' gem 'font-awesome-sass', '~> 5.5.0' gem 'interactor', '~> 3.1' gem 'jquery-rails', '~> 4.3' diff --git a/Gemfile.lock b/Gemfile.lock index e0cd2f1..2d046fe 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -178,19 +178,6 @@ GEM docile (1.3.2) domain_name (0.5.20190701) unf (>= 0.0.5, < 1.0.0) - elasticsearch (7.4.0) - elasticsearch-api (= 7.4.0) - elasticsearch-transport (= 7.4.0) - elasticsearch-api (7.4.0) - multi_json - elasticsearch-model (7.0.0) - activesupport (> 3) - elasticsearch (> 1) - hashie - elasticsearch-rails (7.0.0) - elasticsearch-transport (7.4.0) - faraday - multi_json erubi (1.9.0) execjs (2.7.0) factory_bot (4.11.1) @@ -504,8 +491,6 @@ DEPENDENCIES database_cleaner (~> 1.7) devise (~> 4.7) devise-i18n (~> 1.8) - elasticsearch-model (~> 7.0) - elasticsearch-rails (~> 7.0) factory_bot_rails (~> 4.10) faker (~> 1.8) font-awesome-sass (~> 5.5.0) diff --git a/app/models/account.rb b/app/models/account.rb index ef22b57..b19ffe3 100644 --- a/app/models/account.rb +++ b/app/models/account.rb @@ -1,16 +1,6 @@ # frozen_string_literal: true class Account < ApplicationRecord - include Searchable - - settings index: { number_of_shards: 1 } do - mapping dynamic: false do - indexes :nickname, analyzer: 'english' - indexes :public_name, analyzer: 'russian' - indexes :biography, analyzer: 'russian' - end - end - ################ # Associations # ################ diff --git a/app/models/concerns/searchable.rb b/app/models/concerns/searchable.rb deleted file mode 100644 index 5229e42..0000000 --- a/app/models/concerns/searchable.rb +++ /dev/null @@ -1,10 +0,0 @@ -# frozen_string_literal: true - -module Searchable - extend ActiveSupport::Concern - - included do - include Elasticsearch::Model - include Elasticsearch::Model::Callbacks - end -end diff --git a/app/models/person.rb b/app/models/person.rb index f9cec06..1ee1311 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -2,19 +2,9 @@ class Person < ApplicationRecord include Nameable - include Searchable ACCOUNT_CONNECTION_TOKEN_RE = /\A\w+\z/.freeze - settings index: { number_of_shards: 1 } do - mapping dynamic: false do - indexes :first_name, analyzer: 'russian' - indexes :middle_name, analyzer: 'russian' - indexes :last_name, analyzer: 'russian' - indexes :place_of_birth, analyzer: 'russian' - end - end - ################ # Associations # ################ diff --git a/config/application.rb b/config/application.rb index 192580d..fa8bbea 100644 --- a/config/application.rb +++ b/config/application.rb @@ -17,8 +17,6 @@ require 'sprockets/railtie' # you've limited to :test, :development, :staging, or :production. Bundler.require(*Rails.groups) -require 'elasticsearch/rails/instrumentation' - require 'csv' module Partynest diff --git a/config/initializers/elasticsearch.rb b/config/initializers/elasticsearch.rb deleted file mode 100644 index c1cb4ff..0000000 --- a/config/initializers/elasticsearch.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -# Be sure to restart your server when you modify this file. - -conf = Rails.application.settings :elasticsearch - -Elasticsearch::Model.client = Elasticsearch::Client.new( - scheme: conf[:ssl] ? :https : :http, - host: String(conf[:host]), - port: Integer(conf[:port]), - user: String(conf[:user]), - password: String(conf[:password]), - - transport_options: { - request: { timeout: 5 }, - ssl: { ca_file: conf.dig(:ssl_params, :ca_file) }, - }, -) diff --git a/config/settings/elasticsearch.yml b/config/settings/elasticsearch.yml deleted file mode 100644 index 3663ae1..0000000 --- a/config/settings/elasticsearch.yml +++ /dev/null @@ -1,20 +0,0 @@ -default: &default - host: <%= ENV.fetch('ELASTICSEARCH_HOST') { 'localhost' } %> - port: <%= ENV.fetch('ELASTICSEARCH_PORT') { 9200 } %> - user: <%= ENV.fetch('ELASTICSEARCH_USER') { 'elastic' } %> - password: <%= ENV.fetch('ELASTICSEARCH_PASSWORD') { 'changeme' } %> - ssl: false - ssl_params: - ca_file: null - -development: - <<: *default - -test: - <<: *default - -staging: - <<: *default - -production: - <<: *default diff --git a/lib/tasks/elasticsearch.rake b/lib/tasks/elasticsearch.rake deleted file mode 100644 index 3e5d6f8..0000000 --- a/lib/tasks/elasticsearch.rake +++ /dev/null @@ -1,6 +0,0 @@ -# frozen_string_literal: true - -require 'elasticsearch/rails/tasks/import' - -Rake::Task['elasticsearch:import:all'].prerequisites << :environment -Rake::Task['elasticsearch:import:model'].prerequisites << :environment