Removed some printouts
This commit is contained in:
parent
7cf5677221
commit
e4d9d0f17b
@ -182,7 +182,6 @@ $(document).ready(function()
|
||||
q: request.term, // in flask, "q" will be the argument to look for using request.args
|
||||
}, function(data) {
|
||||
response(data); // matching_results from jsonify
|
||||
console.log("this" + data);
|
||||
});
|
||||
},
|
||||
search: function() {
|
||||
|
10
app/views.py
10
app/views.py
@ -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')
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user