rewrite querysearch and invertedlist to fit aws