Skip to content

Commit f1eb2e2

Browse files
committed
improved find workflow
1 parent 6d7b92d commit f1eb2e2

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

db/sql/04-find_samples.sql

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,14 @@ if (@response is null) begin
4242
declare @q nvarchar(max) = 'SET @s = (' + @rq + ')';
4343
exec sp_executesql @q, N'@s NVARCHAR(MAX) OUTPUT', @s = @samples output
4444
--print @samples
45-
end
4645

47-
/* If not results coming from SQL execution, try SEMANTIC anyway */
48-
if (@samples is null) begin
49-
set @rt = 'SQL+SEMANTIC'
46+
/* If not results coming from SQL execution, try SEMANTIC anyway */
47+
if (@samples is null) begin
48+
set @rt = 'SQL+SEMANTIC'
49+
end
5050
end
5151

52+
5253
/* Find the samples most similar to the requested topic */
5354
if (@rt like '%SEMANTIC%') begin
5455
set @k = coalesce(@k, 50)
@@ -83,8 +84,6 @@ if (@response is null) begin
8384
order by distance_score for json path
8485
)
8586
end
86-
87-
8887

8988
--select @samples;
9089
if (@samples is not null) begin

0 commit comments

Comments
 (0)