Fixing non working autocomplete + rewrite of the autocomplete query.