sort and query products