File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -104,17 +104,16 @@ def find_documents(self, search_term):
104
104
if not common_idx_of_docs : # the search term does not exist
105
105
return []
106
106
107
- # print(common_idx_of_docs)
108
- self ._documents_with_idx (common_idx_of_docs )
107
+ return self ._documents_with_idx (common_idx_of_docs )
109
108
110
109
def _documents_with_idx (self , idxs ):
110
+ idxs = list (idxs )
111
111
cur = self .conn .cursor ()
112
- # reverse_idx = cur.execute("SELECT value FROM IdToDoc WHERE id=(?) or id=(?)", ()).fetchone()[0]
113
- sql = "SELECT value FROM IdToDoc WHERE id in ({seq})" .format (
112
+ sql = "SELECT document FROM IdToDoc WHERE id in ({seq})" .format (
114
113
seq = ',' .join (['?' ]* len (idxs ))
115
- )
116
- result = cur .execute (sql , idxs )
117
- print (result )
114
+ )
115
+ result = cur .execute (sql , idxs ). fetchall ()
116
+ return (result )
118
117
119
118
120
119
if __name__ == "__main__" :
You can’t perform that action at this time.
0 commit comments