Merge pull request #101 from buster-so/dal/term_search_bug

Dal/term search bug
This commit is contained in:
dal 2025-02-05 15:23:49 -08:00 committed by GitHub
commit 80d3662c3f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 0 deletions

View File

@ -1227,6 +1227,7 @@ async fn search_for_relevant_terms(
terms_search
where
fts @@ websearch_to_tsquery('{prompt}')
and organization_id = '{organization_id}'
order by rank_ix
limit least(10, 30) * 2
),
@ -1236,6 +1237,7 @@ semantic as (
row_number() over (order by embedding <#> '{prompt_embedding}') as rank_ix
from
terms_search
where organization_id = '{organization_id}'
order by rank_ix
limit least(10, 30) * 2
)

View File

@ -8,6 +8,11 @@ You should talk about how you tried to fix the SQL query three times, and that y
At the end make sure to apologize to the user
PLEASE OUTPUT THE SQL QUERY IN THE FOLLOWING FORMAT:
```sql
<sql_query>
```
### GENERAL GUIDELINES
- Keep your response under 50 words
- Do not output the failed SQL query in your response