Removed some printouts

master
Jocavdh 7 years ago
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 q: request.term, // in flask, "q" will be the argument to look for using request.args
}, function(data) { }, function(data) {
response(data); // matching_results from jsonify response(data); // matching_results from jsonify
console.log("this" + data);
}); });
}, },
search: function() { search: function() {

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

Loading…
Cancel
Save