diff --git a/templates/search/search.html b/templates/search/search.html index 7137a3119..de3f026a3 100644 --- a/templates/search/search.html +++ b/templates/search/search.html @@ -164,10 +164,13 @@

-
+
{% display_search_option "compute_clusters" %}
{% display_search_option "similar_to" %}
+
+
{% display_search_option "include_audio_problems" %}
+
{% endif %} diff --git a/utils/search/search_query_processor_options.py b/utils/search/search_query_processor_options.py index b4a0f025e..9db135610 100644 --- a/utils/search/search_query_processor_options.py +++ b/utils/search/search_query_processor_options.py @@ -181,6 +181,8 @@ def __copy2__(self): class SearchOptionBool(SearchOption): + """SearchOption class to represent bool options. + """ value_default = False def get_value_from_request(self): @@ -198,6 +200,16 @@ def as_filter(self): updating this class to support a different behavior.""" if self.value_to_apply == True: return super().as_filter() + + +class SearchOptionBoolFilterInverted(SearchOptionBool): + """SearchOption class to represent bool options which should have the filter value inverted. + For example, an "exclude some sounds" option which, when set to "on", the filter in the search + engine should be inverted, e.g. "sound_has_property:0". + """ + + def format_value(self, value): + return '0' if value else '1' class SearchOptionInt(SearchOption):