Skip to content

Commit

Permalink
Limit search term examples to 1000
Browse files Browse the repository at this point in the history
  • Loading branch information
derneuere committed Jun 17, 2023
1 parent 87a24d1 commit aa7188e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api/api_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def get_search_term_examples(user):
"for file path or file name",
]

pp = Photo.objects.filter(owner=user).exclude(captions_json={})
pp = Photo.objects.filter(owner=user).exclude(captions_json={})[:1000]
possible_ids = list(pp.values_list("image_hash", flat=True))
if len(possible_ids) > 99:
possible_ids = random.choices(possible_ids, k=100)
Expand Down

0 comments on commit aa7188e

Please sign in to comment.