diff --git a/app/main/views/corpus.py b/app/main/views/corpus.py index fc737469..f8f11b9c 100644 --- a/app/main/views/corpus.py +++ b/app/main/views/corpus.py @@ -7,6 +7,9 @@ from ...models import Corpus, WordToken +AUTOCOMPLETE_LIMIT = 20 + + @main.route('/corpus/new', methods=["POST", "GET"]) def corpus_new(): """ Register a new corpus @@ -84,7 +87,7 @@ def corpus_allowed_values_api(corpus_id, allowed_type): group_by=True, type_like=allowed_type, allowed_list=corpus.get_allowed_values(allowed_type=allowed_type).count() > 0 - ).all() + ).limit(AUTOCOMPLETE_LIMIT) if result is not None ] )