|
|
|
@ -445,20 +445,16 @@ def autocomplete_search():
|
|
|
|
|
#query = request.form['search']
|
|
|
|
|
query = request.args.get('q')
|
|
|
|
|
query_tokenized = query.lower().split()
|
|
|
|
|
print(query_tokenized)
|
|
|
|
|
#print(query_tokenized)
|
|
|
|
|
word_1 = query_tokenized[-2]
|
|
|
|
|
word_2 = query_tokenized[-1]
|
|
|
|
|
print(word_1)
|
|
|
|
|
print(word_2)
|
|
|
|
|
#print(word_1)
|
|
|
|
|
#print(word_2)
|
|
|
|
|
autocomplete_output = autocomplete.predict(word_1 , word_2)
|
|
|
|
|
autocomplete_suggestions.clear()
|
|
|
|
|
for suggestion, score in autocomplete_output:
|
|
|
|
|
autocomplete_suggestions.append(suggestion)
|
|
|
|
|
|
|
|
|
|
session['autocomplete_suggestions'] = str(autocomplete_suggestions)
|
|
|
|
|
|
|
|
|
|
print(session['autocomplete_suggestions'])
|
|
|
|
|
|
|
|
|
|
return Response(json.dumps(autocomplete_suggestions), mimetype='application/json')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|