dotnet-spanner-entity-framework icon indicating copy to clipboard operation
dotnet-spanner-entity-framework copied to clipboard

Update to EF 9.0 and use Vector Search capability

Open abbottships opened this issue 1 year ago • 3 comments

Thanks for stopping by to let us know something could be better!

Is your feature request related to a problem? Please describe. Cloud Spanner has introduced Vector Search capabilities; which EF 9.0 now has native support for with the IsVector extension methods.

See: https://learn.microsoft.com/en-us/ef/core/what-is-new/ef-core-9.0/whatsnew#vector-similarity-search-preview

Describe the solution you'd like Be able to define a column as a Vector type using EF and the DDL created for Cloud Spanner marks up the ARRAY type as a Vector index.

    protected override void OnModelCreating(ModelBuilder modelBuilder)
    {
        modelBuilder.Entity<Blog>()
            .Property(b => b.Embeddings)
            .IsVector(DistanceFunction.Cosine, dimensions: 1536);
    }

When using the Where predicate, if the operator is a Vector Search, the translated SQL statements generated are vector searches:

var blogs = await context.Blogs
    .OrderBy(s => EF.Functions.VectorDistance(s.Vector, vector))
    .Take(5)
    .ToListAsync();

abbottships avatar Dec 17 '24 13:12 abbottships

Any updates on this? .NET 9 EF isn't usable without this bump..

abbottships avatar Jun 05 '25 11:06 abbottships

Any update as to when this package will reference EF Core 9 ?

SGalovVSG avatar Jun 24 '25 06:06 SGalovVSG

Any update as to when this package will reference EF Core 9 ?

@SGalovVSG We are currently not planning on updating this package to support EF Core 9. We normally only support the LTS versions of EF Core. We've updated the README to reflect this.

olavloite avatar Jul 31 '25 11:07 olavloite