FIX: Add table name to remove ambiguous column reference in SQL (#449)

This commit is contained in:
Rafael dos Santos Silva 2024-01-30 15:50:26 -03:00 committed by GitHub
parent 57d350c913
commit b41c5cc31c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -75,7 +75,7 @@ module DiscourseAi
.public_posts .public_posts
.where("topics.visible") .where("topics.visible")
.where(topic_id: candidate_topic_ids, post_number: 1) .where(topic_id: candidate_topic_ids, post_number: 1)
.order("array_position(ARRAY#{candidate_topic_ids}, topic_id)") .order("array_position(ARRAY#{candidate_topic_ids}, posts.topic_id)")
query_filter_results = search.apply_filters(semantic_results) query_filter_results = search.apply_filters(semantic_results)