Skip to content

Commit

Permalink
fix exception when no date on patent.
Browse files Browse the repository at this point in the history
  • Loading branch information
Patent2net committed Jul 20, 2022
1 parent 4580096 commit d1ae4d8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Patent2Net/P2N-Indexer.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,12 +210,13 @@ def iramCleaner (texte):
for cont in bre[cle]:
if len(cont) > 0:
doc[cle + str(counter + 1)] = cont
if doc ['date'] != '1-1-1':
try:
res = es.index(index=ndf.lower(), id=cpt, body=doc)
else:
except:
print (type(bre["date"]), " : ", bre["date"])
doc['date'] = '1000'
res = es.index(index=ndf.lower(), id=cpt, body=doc)
print(res['result'])
print(res['result'])

lstFr, lstEn, lstUnk = GenereListeFichiers(Rep)
print()
Expand Down

0 comments on commit d1ae4d8

Please sign in to comment.