diff --git a/app/classes/pattern_search/name.rb b/app/classes/pattern_search/name.rb index 6f654b2e5d..15e04ff07a 100644 --- a/app/classes/pattern_search/name.rb +++ b/app/classes/pattern_search/name.rb @@ -49,8 +49,8 @@ def model def build_query super - # Temporary hack to get include_subtaxa/synonyms to work. - # NOTE: this affects the index title. Let's keep it + # This converts any search that *looks like* a name search into + # an actual name search. NOTE: This affects the index title. return unless args[:include_subtaxa].present? || args[:include_synonyms].present? diff --git a/app/classes/query/image_base.rb b/app/classes/query/image_base.rb index 6a0902898f..1a706b84f1 100644 --- a/app/classes/query/image_base.rb +++ b/app/classes/query/image_base.rb @@ -18,6 +18,7 @@ def parameter_declarations by_user?: User, users?: [User], locations?: [:string], + outer?: :query, # for images inside observations observation?: Observation, # for images inside observations observations?: [Observation], project?: Project, @@ -34,8 +35,7 @@ def parameter_declarations quality?: [:float], confidence?: [:float], ok_for_export?: :boolean, - pattern?: :string, - outer?: :query # for images inside observations + pattern?: :string ).merge(names_parameter_declarations) end diff --git a/app/classes/query/initializers/advanced_search.rb b/app/classes/query/initializers/advanced_search.rb index 63efdf00e7..35ba34ad4b 100644 --- a/app/classes/query/initializers/advanced_search.rb +++ b/app/classes/query/initializers/advanced_search.rb @@ -6,6 +6,7 @@ module Initializers module AdvancedSearch # NOTE: The autocomplaters for name, location, and user all make the ids # available now, so this could be a lot more efficient. + # But sometimes you're looking for strings that aren't ids. def advanced_search_parameter_declarations { name?: :string,