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)
| 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 | """ |