@@ -48,10 +48,8 @@ impl ContextualPriority for Table {
48
48
fn relevance_score ( & self , ctx : & TreesitterContext ) -> f32 {
49
49
let mut score = 0.0 ;
50
50
51
- // Highest priority: table explicitly mentioned in the query
52
51
for ( schema_opt, tables) in & ctx. mentioned_relations {
53
52
if tables. contains ( & self . name ) {
54
- // Extra points if schema also matches
55
53
if schema_opt. as_deref ( ) == Some ( & self . schema ) {
56
54
score += 200.0 ;
57
55
} else {
@@ -60,16 +58,6 @@ impl ContextualPriority for Table {
60
58
}
61
59
}
62
60
63
- // Check if table is mentioned via alias
64
- if ctx
65
- . mentioned_table_aliases
66
- . values ( )
67
- . any ( |table_name| * table_name == self . name )
68
- {
69
- score += 140.0 ;
70
- }
71
-
72
- // Medium priority: same schema as mentioned tables
73
61
if ctx
74
62
. mentioned_relations
75
63
. keys ( )
@@ -78,8 +66,7 @@ impl ContextualPriority for Table {
78
66
score += 50.0 ;
79
67
}
80
68
81
- // Lower priority: public schema
82
- if self . schema == "public" {
69
+ if self . schema == "public" && score == 0.0 {
83
70
score += 10.0 ;
84
71
}
85
72
0 commit comments