You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Save TsVector with custom weights gives error "the query has switched to client-evaluation" #1899
System.InvalidOperationException: The 'ToTsVector' method is not supported because the query has switched to client-evaluation. This usually happens when the arguments to the method cannot be translated to server. Rewrite the query to avoid client evaluation of arguments so that method can be translated to server.
at Microsoft.EntityFrameworkCore.NpgsqlFullTextSearchDbFunctionsExtensions.ToTsVector(DbFunctions _, String config, String document)
@dctremblay sorry for responding so late on this...
You can only use the EF.Functions inside queries - EF.Functions.ToTsVector translates to the PostgreSQL to_tsvector function; there is no .NET implementation that can be executed client-side.
Typically, tsvector columns are auto-updated, e.g. by making them generated columns (see the docs). If you'd like to update tsvectors manually, you need to instantiate a TsVector in .NET and assign that as you would with any other column type.
I'm closing this for now, but please don't hesitate to post back with further questions.
Reacted by David Côté-Tremblay, Thorsten Sommer, feugen24 and Arad Alvand
Activity
roji commentedon Jul 16, 2021
@dctremblay sorry for responding so late on this...
You can only use the EF.Functions inside queries - EF.Functions.ToTsVector translates to the PostgreSQL
to_tsvectorfunction; there is no .NET implementation that can be executed client-side.Typically, tsvector columns are auto-updated, e.g. by making them generated columns (see the docs). If you'd like to update tsvectors manually, you need to instantiate a TsVector in .NET and assign that as you would with any other column type.
I'm closing this for now, but please don't hesitate to post back with further questions.