forked from e621ng/e621ng
[Elasticsearch] Remove elasticsearch-model gem
This should be the bulk of the work to integrate with opensearch-ruby
This commit is contained in:
parent
ddcb7c1af1
commit
0bd651c08b
2
Gemfile
2
Gemfile
@ -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'
|
||||||
|
@ -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
|
||||||
|
@ -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
|
|
@ -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(
|
||||||
|
@ -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)
|
||||||
|
@ -1 +0,0 @@
|
|||||||
Elasticsearch::Model.client = Elasticsearch::Client.new host: Danbooru.config.elasticsearch_host
|
|
Loading…
Reference in New Issue
Block a user