MCPcopy Create free account
hub / github.com/geekcomputers/Python / _find_documents_with_idx

Method _find_documents_with_idx

Search_Engine/backend.py:124–139  ·  view source on GitHub ↗

Returns - list[str]: the list of documents with the idxs Input - list of idxs --------- - use the class-level connection object to retrieve the documents that have the idx in the input list of idxs. - retrieve and return these documents as a list

(self, idxs)

Source from the content-addressed store, hash-verified

122 return self._find_documents_with_idx(common_idx_of_docs)
123
124 def _find_documents_with_idx(self, idxs):
125 """
126 Returns - list[str]: the list of documents with the idxs
127 Input - list of idxs
128 ---------
129 - use the class-level connection object to retrieve the documents that
130 have the idx in the input list of idxs.
131 - retrieve and return these documents as a list
132 """
133 idxs = list(idxs)
134 cur = self.conn.cursor()
135 sql = "SELECT document FROM IdToDoc WHERE id in ({seq})".format(
136 seq=",".join(["?"] * len(idxs))
137 )
138 result = cur.execute(sql, idxs).fetchall()
139 return result
140
141
142if __name__ == "__main__":

Callers 1

find_documentsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected