Skip to content

Commit 5e5f4cc

Browse files
authored
Merge pull request #137 from OpenUpSA/reindex
reindex endpoint
2 parents b1764c5 + 3c5bf8e commit 5e5f4cc

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

app.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2678,21 +2678,20 @@ class Reindex(Resource):
26782678
@require_permission('system_admin_access')
26792679
def post(self):
26802680

2681-
"""Reindex all published samples in Elasticsearch"""
2681+
"""Reindex all isolates in Elasticsearch"""
26822682

26832683
try:
26842684
with get_db_cursor() as cursor:
26852685
cursor.execute("""
26862686
SELECT i.*
26872687
FROM isolates i
2688-
WHERE i.status = 'published'
26892688
""")
26902689

2691-
published_isolates = cursor.fetchall()
2690+
all_isolates = cursor.fetchall()
26922691

26932692
reindexed_count = 0
26942693

2695-
for isolate in published_isolates:
2694+
for isolate in all_isolates:
26962695
# Check if isolate exists in Elasticsearch
26972696
es_exists = check_isolate_in_elastic(isolate['id'])
26982697
if not es_exists:

0 commit comments

Comments
 (0)