That AJAX request builds a request of type: /products?index=0, so you need to use uri.query('index') to get the value. uri.param() is to be used for grav parameters, which are more readable, e.g. site.com/products/index:0/, but the jQuery Ajax call does not builds urls in this style.
Also, don’t point your request to products.json.twig. Point it to products, if that is the URL that lists the products, and ask the server to return JSON, or use $.getJSON instead.