search: move misc search parsing helpers to PostQueryBuilder.

* Move various search parser helper methods (`has_metatag?`,
  `is_single_tag?` et al) from PostSets and the Tag model to
  PostQueryBuilder.

* Fix various minor bugs stemming from trying to check if a search query
  contains certain metatags using regexes or other adhoc techniques.
This commit is contained in:
evazion
2020-04-23 01:51:30 -05:00
parent 3dab648d0e
commit dd0d9dff4a
15 changed files with 114 additions and 147 deletions

View File

@@ -15,7 +15,7 @@ module PostsHelper
def missed_post_search_count_js
return unless post_search_counts_enabled?
return unless params[:ms] == "1" && @post_set.post_count == 0 && @post_set.is_single_tag?
return unless params[:ms] == "1" && @post_set.post_count == 0 && @post_set.query.is_single_term?
sig = generate_reportbooru_signature(params[:tags])
render "posts/partials/index/missed_search_count", sig: sig