Added ability to search for URL array parameters

- Also added in different string splitters for the text fields
- Removed or renamed parameters covered by the main search function
This commit is contained in:
BrokenEagle
2020-01-19 23:55:35 +00:00
parent 4a7322b197
commit 34368272e8
5 changed files with 18 additions and 16 deletions

View File

@@ -72,11 +72,11 @@ class WikiPage < ApplicationRecord
def search(params = {})
q = super
q = q.search_attributes(params, :is_locked, :is_deleted, :body)
q = q.search_attributes(params, :is_locked, :is_deleted, :body, :title, :other_names)
q = q.text_attribute_matches(:body, params[:body_matches], index_column: :body_index, ts_config: "danbooru")
if params[:title].present?
q = q.where_like(:title, normalize_title(params[:title]))
if params[:title_normalize].present?
q = q.where_like(:title, normalize_title(params[:title_normalize]))
end
if params[:other_names_match].present?