From 2a43720e6c839e628656cd9ae2a8249134a27111 Mon Sep 17 00:00:00 2001 From: Bomme <13520622+Bomme@users.noreply.github.com> Date: Tue, 30 Apr 2024 21:51:48 +0200 Subject: [PATCH 1/3] convert license to a docValues field for faster SOLR faceting --- utils/search/solr9/cores/freesound/conf/schema.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/search/solr9/cores/freesound/conf/schema.xml b/utils/search/solr9/cores/freesound/conf/schema.xml index 6655ea878..d8d3a0875 100644 --- a/utils/search/solr9/cores/freesound/conf/schema.xml +++ b/utils/search/solr9/cores/freesound/conf/schema.xml @@ -194,7 +194,7 @@ - + @@ -251,4 +251,4 @@ - \ No newline at end of file + From e4b7014ad8e10823ed7fb7c1d84af1eefe55d1a9 Mon Sep 17 00:00:00 2001 From: Bomme <13520622+Bomme@users.noreply.github.com> Date: Thu, 2 May 2024 17:54:36 +0200 Subject: [PATCH 2/3] The license field in solr is no longer case-insensitive --- search/templatetags/search.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/search/templatetags/search.py b/search/templatetags/search.py index 0d60eac36..186c0cfa8 100644 --- a/search/templatetags/search.py +++ b/search/templatetags/search.py @@ -90,10 +90,6 @@ def display_facet(context, facet_name, facet_title=None): element['display_value'] = element['value'][element['value'].find("_")+1:] elif element['value'] == settings.FCW_FILTER_VALUE: element['display_value'] = "Approved for Free Cultural Works" - elif facet_name == 'license': - # License field in solr is case insensitive and will return facet names in lowercase. - # We need to properly capitalize them to use official CC license names. - element['display_value'] = element['value'].title().replace('Noncommercial', 'NonCommercial') elif facet_type == 'range': # Update display value for range facets gap = sqp.facets[facet_name]['gap'] @@ -157,4 +153,4 @@ def display_search_option(context, option_name, widget=None): search_query_processor_options.SearchOptionChoice: 'select', }.get(type(option), 'text') label = option.label if option.label else option_name.capitalize().replace('_', ' ') - return {'option': option, 'option_name': option_name, 'label': label, 'widget': widget} \ No newline at end of file + return {'option': option, 'option_name': option_name, 'label': label, 'widget': widget} From 0942fac15b52c5054a705bdf2189b8a648ca4689 Mon Sep 17 00:00:00 2001 From: ffont Date: Tue, 15 Oct 2024 14:11:39 +0200 Subject: [PATCH 3/3] Fix free cultural works filter value for case sensitiveness --- freesound/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/freesound/settings.py b/freesound/settings.py index 6398ede81..15205d942 100644 --- a/freesound/settings.py +++ b/freesound/settings.py @@ -564,7 +564,7 @@ # ------------------------------------------------------------------------------- # Search engine -FCW_FILTER_VALUE = '("attribution" OR "creative commons 0")' +FCW_FILTER_VALUE = '("Attribution" OR "Creative Commons 0")' # Define the names of some of the indexed sound fields which are to be used later SEARCH_SOUNDS_FIELD_ID = 'sound_id'