Build an Index
Build an Index
1 import time 2 from reasoner import Reasoner 3 4 r = Reasoner(api_key=”foobar”) 5 index = r.indexes.get("your-index-uid") 6 index_uid = index["uid"] 7 8 ... # Add files and urls 9 10 # Build the index with a blocking call 11 updated_index = r.indexes.build(index_uid, wait=True) 12 13 # Or start building the index (non-blocking call) 14 updated_index = await r.indexes.build(index_uid) 15 16 while True: 17 updated_index = r.indexes.get(index_uid) 18 if updated_index.status == 'success': 19 break 20 21 time.sleep(5)