drop elastic

This commit is contained in:
2025-07-11 19:24:30 -03:00
parent 1b710c81f6
commit ef2ba6d114
5 changed files with 55 additions and 58 deletions

View File

@@ -109,22 +109,6 @@ if __name__ == '__main__':
for line in tqdm(reader, desc=f'Processing lines in {file}'):
put_item(line, table_name, dynamodb_client) # type: ignore
# Scan DynamoDB tables and index the data into Elasticsearch
# for file in tqdm(jsonl_files, desc='Scanning tables'):
# table_name = file.removesuffix('.jsonl')
# elastic.delete_index(table_name)
# for doc in tqdm(
# scan_table(
# table_name,
# dynamodb_client,
# FilterExpression='sk = :sk',
# ExpressionAttributeValues={':sk': {'S': '0'}},
# ),
# desc=f'Indexing {table_name}',
# ):
# elastic.index_item(id=doc['id'], index=table_name, doc=doc)
# Scan DynamoDB tables and index the data into Meilisearch
for file in tqdm(jsonl_files, desc='Scanning tables'):
table_name = file.removesuffix('.jsonl')
@@ -139,15 +123,12 @@ if __name__ == '__main__':
desc=f'Indexing {table_name}',
):
meili_client.index(table_name).add_documents([doc], serializer=JSONEncoder)
if table_name == 'test-enrollments':
print('a')
print(doc)
meili_client.index('pytest').add_documents([doc], serializer=JSONEncoder)
index = meili_client.index(table_name)
index.update_settings(
{
'sortableAttributes': ['create_date'],
'filterableAttributes': ['metadata__tenant_id'],
'sortableAttributes': ['create_date', 'createDate'],
'filterableAttributes': ['tenant_id', 'status'],
}
)