28/05/22 - 13h30

master
ChérifBALDE 2022-05-28 13:39:34 +02:00 committed by cherif
parent f982466549
commit fa979638f6
2 changed files with 12 additions and 3 deletions

View File

@ -95,6 +95,13 @@ de retour à faire sur une requet de recherche
QUERY_LIMIT_ROW = 50
'''
Cette varibal definit le nombre max
Cette variable definit le nombre max
retour à faire sur page d'acceuil '''
MAINPAGE_QUERY_LIMIT_ROW = 50
MAINPAGE_QUERY_LIMIT_ROW = 50
'''
Cette variable definit le nombre de mots retourné dans le
cas d'une aide à avec une recherche vide
'''
HELP_WORD_QUERY_LIMIT = 3

View File

@ -929,7 +929,9 @@ def GetMotFromElaIndex(diction):
search_expr = re.compile(f".*{search}.*", re.I)
print(" #### mot recu "+mot+" search_expr = "+str(search_expr))
for x in coll_name.find({'mots': {'$regex': search_expr}}).sort([("occurence", pymongo.DESCENDING)]).limit(5):
for x in coll_name.find({'mots': {'$regex': search_expr}}).\
sort([("occurence", pymongo.DESCENDING)]).\
limit(MYSY_GV.HELP_WORD_QUERY_LIMIT):
if( x['mots'] not in training_mots ):
training_mots.append(x['mots'])