From 927067139ce6036449f065c1d397e54b4cae790c Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 22 Feb 2022 10:14:32 +0100 Subject: [PATCH] Fix case sensitive tag search --- server/lib/elastic-search/elastic-search-videos.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/server/lib/elastic-search/elastic-search-videos.ts b/server/lib/elastic-search/elastic-search-videos.ts index 0c52ec1..14acec1 100644 --- a/server/lib/elastic-search/elastic-search-videos.ts +++ b/server/lib/elastic-search/elastic-search-videos.ts @@ -109,7 +109,10 @@ async function queryVideos (search: VideosSearchQuery) { if (search.tagsOneOf) { filter.push({ terms: { - tags: search.tagsOneOf + 'tags.raw': { + value: search.tagsOneOf, + case_insensitive: true + } } }) } @@ -118,7 +121,10 @@ async function queryVideos (search: VideosSearchQuery) { for (const t of search.tagsAllOf) { filter.push({ term: { - tags: t + 'tags.raw': { + value: t, + case_insensitive: true + } } }) }