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 adde130 commit 4580096
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Patent2Net/P2N-Indexer.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,11 @@ def iramCleaner (texte):
for cont in bre[cle]:
if len(cont) > 0:
doc[cle + str(counter + 1)] = cont

res = es.index(index=ndf.lower(), id=cpt, body=doc)
if doc ['date'] != '1-1-1':
res = es.index(index=ndf.lower(), id=cpt, body=doc)
else:
doc['date'] = '1000'
res = es.index(index=ndf.lower(), id=cpt, body=doc)
print(res['result'])

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

0 comments on commit 4580096

Please sign in to comment.