Add code to include manhattan distance
@@ -104,10 +104,13 @@ func NewShard(ctx context.Context, promMetrics *monitoring.PrometheusMetrics,
case "l2-squared":
distProv = distancer.NewL2SquaredProvider()
// here I can add new cases for manhattan distance, minowski distance etc
+ case "manhattan":
+ // set distProv as distancer.NewManhattanProvide()
+ distProv = distancer.NewManhattanProvider()
default:
return nil, errors.Errorf("unrecognized distance metric %q,"+
"choose one of [\"cosine\", \"l2-squared\"]", hnswUserConfig.Distance)
- }
+ } // add manhanntan to this default as well
vi, err := hnsw.New(hnsw.Config{
Logger: index.logger,
