T52710 search on id works

This commit is contained in:
2017-12-08 13:12:39 +01:00
parent b6a93452cd
commit 533544117b
4 changed files with 67 additions and 41 deletions

View File

@@ -21,32 +21,23 @@ def push_updated_user(user_to_index: dict):
Push an update to the Elastic index when
a user item is updated.
"""
log.warning(
'WIP USER ELK INDEXING %s %s',
user_to_index.get('username'),
user_to_index.get('objectID'))
doc = documents.create_doc_from_user_data(user_to_index)
log.debug('UPDATE USER %s', doc._id)
doc.save()
log.warning('CREATED ELK USER DOC')
def index_node_save(node_to_index: dict):
log.warning(
'ELK NODE INDEXING %s',
node_to_index.get('objectID'))
log.warning(node_to_index)
if not node_to_index:
return
doc = documents.create_doc_from_node_data(node_to_index)
log.warning('CREATED ELK NODE DOC')
log.debug('CREATED ELK NODE DOC %s', doc._id)
doc.save()
def index_node_delete(delete_id: str):
log.warning('NODE DELETE INDEXING %s', delete_id)
log.debug('NODE DELETE INDEXING %s', delete_id)
documents.Node(id=delete_id).delete()