예제 #1
0
 def _createDocument(self, cursor, content_hash, title, text, fileSize,
                     lastModifiedOn, filename, state):
     doc = Document(document_id=content_hash,
                    title=title,
                    text=text,
                    size=fileSize,
                    publication_time=lastModifiedOn,
                    download_count=0.,
                    url=filename,
                    matching=0.,
                    indexed='1',
                    state=state)
     doc.commit(cursor, update=False)
     doc = Document.selectWhere(cursor, document_id=content_hash)[0]
     return doc
예제 #2
0
 def _createDocument(self, cursor, content_hash, title, text, fileSize,
                     lastModifiedOn, filename, state):
     doc = Document(document_id=content_hash,
                    title=title,
                    text=text,
                    size=fileSize,
                    publication_time=lastModifiedOn,
                    download_count=0.,
                    url=filename,
                    matching=0.,
                    indexed='1',
                    state=state)
     doc.commit(cursor, update=False)
     doc = Document.selectWhere(cursor, document_id=content_hash)[0]
     return doc
예제 #3
0
    def _createDocument(self, cursor, futureDoc):

        doc = Document(document_id=futureDoc.content_hash,
                       title=futureDoc.title,
                       text=futureDoc.text[:MAX_STORED_SIZE],
                       size=futureDoc.fileSize,
                       publication_time=futureDoc.lastModificationTime,
                       download_count=0.,
                       url=futureDoc.filename,
                       mime_type=futureDoc.mime_type,
                       matching=0.,
                       indexed='1',
                       state=futureDoc.state)
        doc.commit(cursor, update=False)
        doc = Document.selectWhere(cursor, document_id=futureDoc.content_hash)[0]
        return doc
예제 #4
0
    def _createDocument(self, cursor, futureDoc):

        doc = Document(document_id=futureDoc.content_hash,
                       title=futureDoc.title,
                       text=futureDoc.text[:MAX_STORED_SIZE],
                       size=futureDoc.fileSize,
                       publication_time=futureDoc.lastModificationTime,
                       download_count=0.,
                       url=futureDoc.filename,
                       mime_type=futureDoc.mime_type,
                       matching=0.,
                       indexed='1',
                       state=futureDoc.state)
        doc.commit(cursor, update=False)
        doc = Document.selectWhere(cursor, document_id=futureDoc.content_hash)[0]
        return doc