We examine the notion of a price index as the solution to the problem of minimizing the distance between the index values and the vector of price ratios. To do so, the choice of a suitable distance function is of crucial importance. We use a generalized least-squares criterion for this purpose and show that the generalized quasilinear functions are the only solutions to the problem of minimizing the distance thus defined. There are numerous special cases that are obtained for specific choices of the requisite functions and weights. In particular, we show that, in addition to the well-established indexes of Laspeyres, Paasche, Marshall-Edgeworth, Walsh, and Törnqvist, the arithmetic-current-period index, the arithmetic-hybrid index, the harmonic-base-period index, and the harmonic-hybrid index can be obtained with suitably chosen distance functions. Furthermore, the logarithmic least-squares criterion is employed to obtain indexes that are based on geometric means.