18 lines
452 B
Python
18 lines
452 B
Python
import requests
|
|
import utils.config
|
|
from utils.opensearch import opensearch_client
|
|
from utils.reseau_social_data import reseau_social_data as rs_data
|
|
|
|
# %%
|
|
rs_data
|
|
|
|
# %%
|
|
opensearch_client.info()
|
|
|
|
# %%
|
|
for rs in rs_data:
|
|
nom = rs.get("nom")
|
|
for repertoire in rs.get("repertoires", []):
|
|
index_name = f"rs_{nom}_{repertoire}".lower()
|
|
opensearch_client.indices.create(index=index_name)
|
|
print(f"Index '{index_name}' créé")
|