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

Method _add_to_IdToDoc

Search_Engine/backend.py:77–88  ·  view source on GitHub ↗

Returns - int: the id of the inserted document Input - str: a string of words called `document` --------- - use the class-level connection object to insert the document into the db - retrieve and return the row id of the inserted document

(self, document)

Source from the content-addressed store, hash-verified

75 return "index successful"
76
77 def _add_to_IdToDoc(self, document):
78 """
79 Returns - int: the id of the inserted document
80 Input - str: a string of words called `document`
81 ---------
82 - use the class-level connection object to insert the document
83 into the db
84 - retrieve and return the row id of the inserted document
85 """
86 cur = self.conn.cursor()
87 res = cur.execute("INSERT INTO IdToDoc (document) VALUES (?)", (document,))
88 return res.lastrowid
89
90 def find_documents(self, search_term):
91 """

Callers 1

index_documentMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected