Skip to content

Commit

Permalink
Update SQL #780
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmezzetti committed Sep 4, 2024
1 parent ddb6c3e commit ece3b78
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/python/txtai/ann/sqlite.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,7 @@ def searchsql(self):
SELECT
"""

return self.tosql(
("SELECT indexid, 1 - distance " "FROM {table} " f"WHERE embedding MATCH {self.embeddingsql()} " "ORDER BY distance " "LIMIT ?")
)
return self.tosql(("SELECT indexid, 1 - distance FROM {table} " f"WHERE embedding MATCH {self.embeddingsql()} AND k = ? ORDER BY distance"))

def countsql(self):
"""
Expand Down

0 comments on commit ece3b78

Please sign in to comment.