mirror of https://github.com/buster-so/buster.git
Merge pull request #101 from buster-so/dal/term_search_bug
Dal/term search bug
This commit is contained in:
commit
80d3662c3f
|
@ -1227,6 +1227,7 @@ async fn search_for_relevant_terms(
|
||||||
terms_search
|
terms_search
|
||||||
where
|
where
|
||||||
fts @@ websearch_to_tsquery('{prompt}')
|
fts @@ websearch_to_tsquery('{prompt}')
|
||||||
|
and organization_id = '{organization_id}'
|
||||||
order by rank_ix
|
order by rank_ix
|
||||||
limit least(10, 30) * 2
|
limit least(10, 30) * 2
|
||||||
),
|
),
|
||||||
|
@ -1236,6 +1237,7 @@ semantic as (
|
||||||
row_number() over (order by embedding <#> '{prompt_embedding}') as rank_ix
|
row_number() over (order by embedding <#> '{prompt_embedding}') as rank_ix
|
||||||
from
|
from
|
||||||
terms_search
|
terms_search
|
||||||
|
where organization_id = '{organization_id}'
|
||||||
order by rank_ix
|
order by rank_ix
|
||||||
limit least(10, 30) * 2
|
limit least(10, 30) * 2
|
||||||
)
|
)
|
||||||
|
|
|
@ -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
|
At the end make sure to apologize to the user
|
||||||
|
|
||||||
|
PLEASE OUTPUT THE SQL QUERY IN THE FOLLOWING FORMAT:
|
||||||
|
```sql
|
||||||
|
<sql_query>
|
||||||
|
```
|
||||||
|
|
||||||
### GENERAL GUIDELINES
|
### GENERAL GUIDELINES
|
||||||
- Keep your response under 50 words
|
- Keep your response under 50 words
|
||||||
- Do not output the failed SQL query in your response
|
- Do not output the failed SQL query in your response
|
||||||
|
|
Loading…
Reference in New Issue