[Elasticsearch] Remove elasticsearch-model gem

This should be the bulk of the work to integrate with opensearch-ruby
This commit is contained in:
Earlopain 2023-09-16 15:52:05 +02:00
parent ddcb7c1af1
commit 0bd651c08b
No known key found for this signature in database
GPG Key ID: 48860312319ADF61
6 changed files with 4 additions and 22 deletions

View File

@ -29,7 +29,7 @@ gem 'sidekiq-unique-jobs'
gem 'redis' gem 'redis'
gem 'request_store' gem 'request_store'
gem 'elasticsearch-model' gem 'elasticsearch'
gem 'mailgun-ruby' gem 'mailgun-ruby'
gem 'resolv' gem 'resolv'

View File

@ -130,10 +130,6 @@ GEM
elasticsearch-transport (= 7.17.7) elasticsearch-transport (= 7.17.7)
elasticsearch-api (7.17.7) elasticsearch-api (7.17.7)
multi_json multi_json
elasticsearch-model (7.2.1)
activesupport (> 3)
elasticsearch (~> 7)
hashie
elasticsearch-transport (7.17.7) elasticsearch-transport (7.17.7)
faraday (~> 1) faraday (~> 1)
multi_json multi_json
@ -172,7 +168,6 @@ GEM
globalid (1.1.0) globalid (1.1.0)
activesupport (>= 5.0) activesupport (>= 5.0)
hashdiff (1.0.1) hashdiff (1.0.1)
hashie (5.0.0)
http-accept (1.7.0) http-accept (1.7.0)
http-cookie (1.0.5) http-cookie (1.0.5)
domain_name (~> 0.5) domain_name (~> 0.5)
@ -406,7 +401,7 @@ DEPENDENCIES
dotenv-rails dotenv-rails
draper draper
dtext_rb! dtext_rb!
elasticsearch-model elasticsearch
factory_bot_rails factory_bot_rails
httparty httparty
listen listen

View File

@ -1,12 +0,0 @@
# frozen_string_literal: true
# Base Elasticsearch indexing definitions
#
# Make sure to include your custom index file
# in your model alongside Indexable.
module Indexable
def self.included(base)
base.include Elasticsearch::Model
base.include DocumentStore::Model
end
end

View File

@ -1644,7 +1644,7 @@ class Post < ApplicationRecord
include ValidationMethods include ValidationMethods
include PostEventMethods include PostEventMethods
include Danbooru::HasBitFlags include Danbooru::HasBitFlags
include Indexable include DocumentStore::Model
include PostIndex include PostIndex
BOOLEAN_ATTRIBUTES = %w( BOOLEAN_ATTRIBUTES = %w(

View File

@ -119,7 +119,7 @@ class PostVersion < ApplicationRecord
end end
extend SearchMethods extend SearchMethods
include Indexable include DocumentStore::Model
include PostVersionIndex include PostVersionIndex
def self.queue(post) def self.queue(post)

View File

@ -1 +0,0 @@
Elasticsearch::Model.client = Elasticsearch::Client.new host: Danbooru.config.elasticsearch_host