Efcore: SQL Server full-text search: Support creating full-text indexes in migrations

Created on 30 Mar 2018  路  4Comments  路  Source: dotnet/efcore

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.

area-query good first issue type-enhancement

Most helpful comment

Does EF Core 3.1 support migrations to build full-text indexes and catalogs?

All 4 comments

Does EF Core 3.1 support migrations to build full-text indexes and catalogs?

Workaround

migrationBuilder.Sql(
    sql: "CREATE FULLTEXT CATALOG ftCatalog AS DEFAULT;",
    suppressTransaction: true);
migrationBuilder.Sql(
    sql: "CREATE FULLTEXT INDEX ON Posts(Content) KEY INDEX PK_Posts;",
    suppressTransaction: true);

@bricelam Is this something that is supported in EF Core 3.1?

The workaround should work. But there is an issue with Web Deploy not honoring suppressTransaction.

Was this page helpful?
0 / 5 - 0 ratings