Fulltext index Code First EF Core 2.1?

entity-framework-core indexing sql-server

Question

how do I add to my fluent api a full text index?

I just see HasIndex()

 public void Configure(EntityTypeBuilder<Company> builder)
        {
            builder.HasKey(x => x.Id);
            builder.Property(x => x.Id).ValueGeneratedOnAdd();
            builder.HasIndex(x => x.Name);
            builder.Property(x => x.Name).HasMaxLength(100).IsRequired();
        }
1
0
6/25/2018 5:53:58 PM

Accepted Answer

Creation of full text indexes is not supported in EF Core 2.1, there is an issue tracking this at https://github.com/aspnet/EntityFrameworkCore/issues/11488

In summary;

In EF Core 2.1 we have initial support for for full-text search via the FreeText predicate in LINQ, but this only works with databases that have already been indexed. EF Core and the SQL Server provider don't provide any way to configure the model so that migrations or EnsureCreated can generate the right SQL for defining the indexes.

0
7/23/2018 10:38:54 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow