return
note = kwargs['instance']
+ if kwargs['created']:
+ update_note_counts(note)
+
try:
index = SearchIndex()
if kwargs['created']:
- update_note_counts(note)
index.add_note(note)
else:
index.update_note(note, note.old_instance)
update_note_counts(kwargs['instance'])
# Remove document from search index
- index = SearchIndex()
- index.remove_note(note)
+ try:
+ index = SearchIndex()
+ index.remove_note(note)
+ except Exception:
+ logger.error("Error with IndexDen:\n" + traceback.format_exc())
if note.user:
GenericKarmaEvent.create_event(note.user, note.name, GenericKarmaEvent.NOTE_DELETED)
self.api_client = itc.ApiClient(secret.PRIVATE_URL)
if not self.api_client.get_index(self.index_name).exists():
+ time.sleep(5)
self.api_client.create_index(self.index_name, {'public_search': False})
self.index = self.api_client.get_index(self.index_name)