posts: use string_to_array index for tag searches.
Use the `string_to_array(tag_string, ' ')` index instead of the `tag_index` for tag searches. The string_to_array index lets us treat the tag_string as an array for searching purposes. This lets us get rid of the tag_index column and the test_parser dependency in the future.
This commit is contained in:
@@ -1132,7 +1132,7 @@ class Post < ApplicationRecord
|
||||
end
|
||||
|
||||
def raw_tag_match(tag)
|
||||
where("posts.tag_index @@ to_tsquery('danbooru', E?)", tag.to_escaped_for_tsquery)
|
||||
Post.where_array_includes_all("string_to_array(posts.tag_string, ' ')", [tag])
|
||||
end
|
||||
|
||||
# Perform a tag search as an anonymous user. No tag limit is enforced.
|
||||
|
||||
Reference in New Issue
Block a user