Similarity measure has been one of the critical issues for successful content-based retrieval. Simple Euclidean or quadratic forms of distance are often inadequate, as they do not correspond to perceived similarity, nor adapt to different applications. Relevance feedback and/or iterative refinement techniques, based on the user feedback, have been proposed to adjust the similarity metric or the feature space. However, this learning process potentially renders those indices for facilitating high dimensional indexing, such as R-tree useless, as those indexing techniques usually assume a predetermined similarity measure. In this paper, we propose a simultaneous learning and indexing technique, for efficient content-based retrieval of images, that can be described by feature vectors. This technique builds a compact high-dimensional index, while taking into account that the raw feature space needs to be adjusted for each new application. Consequently, much better efficiency can be achieved, as compared to those techniques which do not make provisions for efficient indexing.