You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

22 lines
579 B

import archive
import database
import json
database.init()
archive.init()
with archive.ix.searcher() as searcher:
for docnum in searcher.document_numbers():
try:
if docnum > 500:
break
print('docnum', docnum)
res = searcher.stored_fields(docnum)
print('id', res['id'])
database.put_story(res['story'])
database.put_ref(res['story']['ref'], res['id'])
print()
except BaseException as e:
print('skipping', docnum)
print('reason:', e)