Skip to content

Commit

Permalink
Add Solr core to exported search results CSV file name
Browse files Browse the repository at this point in the history
  • Loading branch information
thriuin committed Nov 24, 2023
1 parent 16dd73a commit 2e49099
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions search/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ def cache_search_results_file(cached_filename: str, sr: SolrResponse, rows=10000
def export_search_results_csv(request_url, query, lang, core):
cache_dir = settings.EXPORT_FILE_CACHE_DIR
hashed_query = hashlib.sha1(request_url.encode('utf8')).hexdigest()
cached_filename = os.path.join(cache_dir, "{0}_{1}.csv".format(hashed_query, lang))
static_filename = f'{settings.EXPORT_FILE_CACHE_URL}/{hashed_query}_{lang}.csv'
cached_filename = os.path.join(cache_dir, f"{core}_{hashed_query}_{lang}.csv")
static_filename = f'{settings.EXPORT_FILE_CACHE_URL}/{core}_{hashed_query}_{lang}.csv'

# Check the cache. If the results already exist,then just return the filename, no need to query Solr
if os.path.exists(cached_filename):
Expand Down

0 comments on commit 2e49099

Please sign in to comment.