Introducing Algolia search for users

With the new dependency, algoliasearch, we can push and store on the
Algolia service a limited set of properties from the Users collection.
This commit is contained in:
2016-02-10 16:13:07 +01:00
parent 4e192acea6
commit c7b6e798c0
5 changed files with 53 additions and 7 deletions

View File

@@ -550,5 +550,14 @@ def test_post_internal(node_id):
print post_internal('nodes', node)
@manager.command
def algolia_push_users():
"""Loop through all users and push them to Algolia"""
from application.utils.algolia import algolia_index_user_save
users_collection = app.data.driver.db['users']
for user in users_collection.find():
print "Pushing {0}".format(user['username'])
algolia_index_user_save(user)
if __name__ == '__main__':
manager.run()