Validation 14/03/22 - 10h21
parent
e294a3899c
commit
783f460562
51424
Log/log_file.log
51424
Log/log_file.log
File diff suppressed because it is too large
Load Diff
28
wrapper.py
28
wrapper.py
|
@ -254,12 +254,21 @@ def recherche_text_simple(diction):
|
|||
new_diction['certif'] = diction['certif']
|
||||
|
||||
price_crit = {}
|
||||
json = {}
|
||||
if ("price" in diction.keys()):
|
||||
if diction['price']:
|
||||
critere_date['price'] = diction['price']
|
||||
if( str( diction['price']) != "NA"):
|
||||
price_crit['price'] = diction['price']
|
||||
prices = str(diction['price']).split(":")
|
||||
if len(prices) > 2 :
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " - Le filtre 'price' a plus 2 informations")
|
||||
return False, " Le filtre prix est incorrect"
|
||||
|
||||
price_crit = {'price': {'$gte': int(str(prices[0])), '$lte': int(str(prices[1]))}}
|
||||
|
||||
|
||||
new_diction['price'] = diction['price']
|
||||
print("{#############"+str(price_crit))
|
||||
|
||||
|
||||
support_crit = {}
|
||||
|
@ -370,12 +379,10 @@ def recherche_text_simple(diction):
|
|||
print( " unique = "+str(y))
|
||||
final_message2.append(y)
|
||||
|
||||
|
||||
|
||||
coll_name = dbname['myclass']
|
||||
|
||||
print(" Dans la recherch TIPS , les critère = " + str(certif_crit) + " la langue = " + str(
|
||||
lang_crit) + " price = " + str(price_crit)+" support = "+str(support_crit))
|
||||
lang_crit) + " price = " + str(price_crit)+" support = "+str(support_crit), " price_crit = "+str(price_crit))
|
||||
|
||||
'''
|
||||
A present mise à jour de la table "user_recherche" avec les resultats trouvés
|
||||
|
@ -405,7 +412,8 @@ def recherche_text_simple(diction):
|
|||
nb_result = 0
|
||||
for x in coll_name.find(({"$and": [{"external_code": {"$in": final_message2}},
|
||||
certif_crit, lang_crit, type_crit, price_crit, support_crit]}),
|
||||
{"_id": 0, "indexed": 0, "indexed_desc": 0, "indexed_obj": 0, "indexed_title": 0, "valide": 0, "locked": 0, "partner_owner_recid": 0, }):
|
||||
{"_id": 0, "indexed": 0, "indexed_desc": 0, "indexed_obj": 0,
|
||||
"indexed_title": 0, "valide": 0, "locked": 0, "partner_owner_recid": 0, }):
|
||||
|
||||
nb_result = nb_result +1
|
||||
my_recid = {}
|
||||
|
@ -463,7 +471,8 @@ def recherche_text_simple(diction):
|
|||
|
||||
coll_name = dbname['myclass']
|
||||
|
||||
print(" Dans la recherch, les critère = "+str(certif_crit)+" la langue = "+str(lang_crit)+" price = "+str(price_crit))
|
||||
print(" Dans la recherch, les critère = "+str(certif_crit)+" la langue = "+str(lang_crit)+
|
||||
" price = "+str(price_crit))
|
||||
|
||||
#ici ajouter tous les critère comme ci-dessous avec le support et le certif
|
||||
'''
|
||||
|
@ -564,14 +573,11 @@ def store_recherche(diction, user_recid=""):
|
|||
if ( len(str(user_recid)) <= 0 ):
|
||||
user_recid = 'None' # by default
|
||||
|
||||
'''
|
||||
field_list = ['search_text', 'token','id','type', 'lang', 'level', 'dist',
|
||||
'price', 'certif', 'source', 'name','valide','certif', 'support','type']
|
||||
'''
|
||||
|
||||
|
||||
field_list = ['token', 'user_ip', 'user_country_code', 'user_country_name', 'user_city',
|
||||
'user_postal', 'user_latitude', 'user_longitude', 'user_state', 'search_text', 'certif',
|
||||
'support', 'type', 'lang', 'price']
|
||||
'support', 'type', 'lang', 'price', 'distance']
|
||||
incom_keys = diction.keys()
|
||||
for val in incom_keys:
|
||||
if val not in field_list:
|
||||
|
|
Loading…
Reference in New Issue