documents = []
for row in job.result():
doc_str = Document(
text=str(row['review_text']),
doc_id=str(row['review_id']),
extra_info={
'rating': str(row['review_rating']),
'asin': str(row['asin']),
'review_date': str(row['review_date']),
},
)
documents.append(doc_str)
review_id
/ doc_id
stays constant, you can call this functionindex.refresh_ref_docs(documents)
which will a) update any doucments with the same doc_id but different content and b) insert any documents with doc_id's that are not already present