Compare commits

...

1 Commits

Author SHA1 Message Date
Tanmay Deep Sharma
040584fc68 optimise the label query by using cached_label_list instead of joins 2025-10-07 10:58:57 +02:00

View File

@@ -156,7 +156,8 @@ class ConversationFinder
def filter_by_labels
return unless params[:labels]
@conversations = @conversations.tagged_with(params[:labels], any: true)
pattern = params[:labels].map { |label| Regexp.escape(label) }.join('|')
@conversations = @conversations.where('cached_label_list ~ ?', "\\y(#{pattern})\\y")
end
def filter_by_source_id