further code added to make autocomplete work for facet search