Learning to hash for large-scale high-dimensional data