mirror of
https://github.com/discourse/discourse-ai.git
synced 2025-06-28 10:32:15 +00:00
FIX: AI Helper category / tag suggestion when user does not categories muted (#1042)
This commit is contained in:
parent
ceac6e5efb
commit
792df58fbc
@ -109,10 +109,12 @@ module DiscourseAi
|
|||||||
schema
|
schema
|
||||||
.asymmetric_similarity_search(raw_vector, limit: limit, offset: 0) do |builder|
|
.asymmetric_similarity_search(raw_vector, limit: limit, offset: 0) do |builder|
|
||||||
builder.join("topics t on t.id = topic_id")
|
builder.join("topics t on t.id = topic_id")
|
||||||
builder.where(<<~SQL, exclude_category_ids: muted_category_ids.map(&:to_i))
|
unless muted_category_ids.empty?
|
||||||
t.category_id NOT IN (:exclude_category_ids) AND
|
builder.where(<<~SQL, exclude_category_ids: muted_category_ids.map(&:to_i))
|
||||||
t.category_id NOT IN (SELECT categories.id FROM categories WHERE categories.parent_category_id IN (:exclude_category_ids))
|
t.category_id NOT IN (:exclude_category_ids) AND
|
||||||
SQL
|
t.category_id NOT IN (SELECT categories.id FROM categories WHERE categories.parent_category_id IN (:exclude_category_ids))
|
||||||
|
SQL
|
||||||
|
end
|
||||||
end
|
end
|
||||||
.map { |r| [r.topic_id, r.distance] }
|
.map { |r| [r.topic_id, r.distance] }
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user