語言

SqlServerQueryableExtensions.FreeTextTable<T,TKey> Method

Definition

Queries a full-text index using the SQL Server FREETEXTTABLE function.

public static System.Linq.IQueryable<Microsoft.EntityFrameworkCore.Query.FullTextSearchResult<TKey>> FreeTextTable<T,TKey>(this Microsoft.EntityFrameworkCore.DbSet<T> source, string freeText, System.Linq.Expressions.Expression<Func<T,object>>? columnSelector = default, string? languageTerm = default, int? topN = default) where T : class;
static member FreeTextTable : Microsoft.EntityFrameworkCore.DbSet<'T (requires 'T : null)> * string * System.Linq.Expressions.Expression<Func<'T, obj>> * string * Nullable<int> -> System.Linq.IQueryable<Microsoft.EntityFrameworkCore.Query.FullTextSearchResult<'Key>> (requires 'T : null)
<Extension()>
Public Function FreeTextTable(Of T As Class, TKey As Class) (source As DbSet(Of T), freeText As String, Optional columnSelector As Expression(Of Func(Of T, Object)) = Nothing, Optional languageTerm As String = Nothing, Optional topN As Nullable(Of Integer) = Nothing) As IQueryable(Of FullTextSearchResult(Of TKey))

Type Parameters

T

The entity type being queried.

TKey

The type of the full-text key column.

Parameters

source
DbSet<T>

The DbSet<TEntity> representing the table with the full-text index.

freeText
String

The text to search for.

columnSelector
Expression<Func<T,Object>>

An optional selector for the column(s) to search. Can be a single property (e.g., e => e.Title) or multiple properties via an anonymous type (e.g., e => new { e.Title, e.Body }). When omitted, all full-text indexed columns are searched.

languageTerm
String

Optional language term from sys.syslanguages for word-breaking.

topN
Nullable<Int32>

Optional maximum number of results to return.

Returns

An IQueryable<T> of FullTextSearchResult<TKey> containing the key and rank of matching rows.

Remarks

Use the Key property to join back to the original table to retrieve the full entity data.

See SQL Server documentation for FREETEXTTABLE for more information.

Applies to