Fix use of index in distance function
Support for custom index fields
Noise filter for distance matrix