FIX: stop returning self as a candidate for related topics (#31)
This commit is contained in:
parent
0d80d9ec49
commit
6543c50758
|
@ -34,6 +34,7 @@ module DiscourseAi
|
|||
.visible
|
||||
.listable_topics
|
||||
.secured
|
||||
.where("id <> ?", topic.id)
|
||||
.where(id: candidate_ids)
|
||||
.order("array_position(ARRAY#{candidate_ids}, id)")
|
||||
.limit(SiteSetting.ai_embeddings_semantic_related_topics)
|
||||
|
|
|
@ -29,6 +29,7 @@ describe DiscourseAi::Embeddings::SemanticRelated do
|
|||
expect(results).to include(normal_topic_1)
|
||||
expect(results).to include(normal_topic_2)
|
||||
expect(results).to include(normal_topic_3)
|
||||
expect(results).to_not include(target)
|
||||
expect(results).to_not include(unlisted_topic)
|
||||
expect(results).to_not include(private_topic)
|
||||
expect(results).to_not include(secured_category_topic)
|
||||
|
|
Loading…
Reference in New Issue