Fix aliased query handling for e621 pool search
This commit is contained in:
parent
13dfa5ce2b
commit
647c0cccdc
@ -13,7 +13,7 @@ class E621PoolQueryBuilder
|
|||||||
|
|
||||||
def add_tag_string_search(query)
|
def add_tag_string_search(query)
|
||||||
tag_list = query.split
|
tag_list = query.split
|
||||||
aliases = E621::TagAlias.where(antecedent_name: tag_list.map { |t| t.sub(/\A([-~])/, "") })
|
aliases = E621::TagAlias.active.where(antecedent_name: tag_list.map { |t| t.sub(/\A([-~])/, "") })
|
||||||
tag_list.map do |tag|
|
tag_list.map do |tag|
|
||||||
type = :must
|
type = :must
|
||||||
if tag =~ /\A([-~])/
|
if tag =~ /\A([-~])/
|
||||||
|
@ -4,6 +4,10 @@ module E621
|
|||||||
class TagAlias < ApplicationRecord
|
class TagAlias < ApplicationRecord
|
||||||
self.table_name = "e621.tag_aliases"
|
self.table_name = "e621.tag_aliases"
|
||||||
|
|
||||||
|
scope :active, -> { where(status: "active") }
|
||||||
|
scope :deleted, -> { where(status: "deleted") }
|
||||||
|
scope :pending, -> { where(status: "pending") }
|
||||||
|
|
||||||
module SyncMethods
|
module SyncMethods
|
||||||
def sync
|
def sync
|
||||||
E621ExportDownloadJob.perform("tag_aliases")
|
E621ExportDownloadJob.perform("tag_aliases")
|
||||||
|
@ -4,6 +4,10 @@ module E621
|
|||||||
class TagImplication < ApplicationRecord
|
class TagImplication < ApplicationRecord
|
||||||
self.table_name = "e621.tag_implications"
|
self.table_name = "e621.tag_implications"
|
||||||
|
|
||||||
|
scope :active, -> { where(status: "active") }
|
||||||
|
scope :deleted, -> { where(status: "deleted") }
|
||||||
|
scope :pending, -> { where(status: "pending") }
|
||||||
|
|
||||||
module SyncMethods
|
module SyncMethods
|
||||||
def sync
|
def sync
|
||||||
E621ExportDownloadJob.perform_later("tag_implications")
|
E621ExportDownloadJob.perform_later("tag_implications")
|
||||||
|
Loading…
Reference in New Issue
Block a user