Repository navigation
Implementation of FreeText translation for SqlServer - #10480
Conversation
| { | ||
| /// <summary> | ||
| /// <para> | ||
| /// A method to call T-SQL FREEETEXT method. It is used to perform full text searches on full text indexed columns |
There was a problem hiding this comment.
@divega @anpete @ajcvickers - Need doc comments for this.
There was a problem hiding this comment.
A DbFunction method stub that can be used in LINQ queries to target the SQL Server FREETEXT store function.
Remarks: This DbFunction method has no in-memory implementation and may throw when the querying is executing in memory. This can happen if the query contains one or more expressions that could not be translated to the store.
b87c9c1 to
872fd5e
Compare
| /// <param name="languageTerm">Language ID from sys.syslanguages table</param> | ||
| public static bool FreeText( | ||
| [CanBeNull] this DbFunctions _, | ||
| [NotNull] string columnName, |
|
|
||
| return Equals(methodCallExpression.Method, _methodInfo) | ||
| ? new SqlFunctionExpression( | ||
| "FREETEXT", |
| { | ||
| get | ||
| { | ||
| var isFullTextInstalled = false; |
| isFullTextInstalled = result == 1; | ||
| } | ||
|
|
||
| sqlConnection.Close(); |
|
|
||
| private static bool FreeTextCore(string columnName, string freeText, int? languageTerm) | ||
| { | ||
| throw new NotImplementedException(); |
There was a problem hiding this comment.
Add an error message and probably InvalidOperation
872fd5e to
860582d
Compare
|
Updated. |
|
Ping! |
| <value>The specified table '{table}' is not valid. Specify tables using the format '[schema].[table]'.</value> | ||
| </data> | ||
| <data name="FreeTextFunctionOnClient" xml:space="preserve"> | ||
| <value>FreeText function is not supported when query is being executed in memory.</value> |
There was a problem hiding this comment.
"The 'FreeText' method is not supported because the query has switched to client-evaluation. Inspect the log to determine which query expressions are triggering client-evaluation."
| /// </para> | ||
| /// </summary> | ||
| /// <remarks> | ||
| /// This DbFunction method has no in-memory implementation and may throw when the querying is executing in memory. |
There was a problem hiding this comment.
"and will throw if the query switches to client-evaluation."
| /// This can happen if the query contains one or more expressions that could not be translated to the store. | ||
| /// </remarks> | ||
| /// <param name="_">DbFunctions instance</param> | ||
| /// <param name="propertyName">The column on which the search will be performed</param> |
There was a problem hiding this comment.
nit: Period at end of param sentences.
| /// <param name="_">DbFunctions instance</param> | ||
| /// <param name="propertyName">The column on which the search will be performed</param> | ||
| /// <param name="freeText">The text that is to be searched</param> | ||
| /// <param name="languageTerm">Language ID from sys.syslanguages table</param> |
There was a problem hiding this comment.
A Language ID from the sys.syslanguages table
| /// </remarks> | ||
| /// <param name="_">DbFunctions instance</param> | ||
| /// <param name="propertyName">The column on which the search will be performed</param> | ||
| /// <param name="freeText">The text that is to be searched</param> |
There was a problem hiding this comment.
"The text that will be searched for in the property."
|
|
||
| public static bool IsTeamCity => Environment.GetEnvironmentVariable("TEAMCITY_VERSION") != null; | ||
|
|
||
| public static bool SupportsFullTextSearch |
860582d to
c49878e
Compare
c49878e to
c786372
Compare
elepner
left a comment
There was a problem hiding this comment.
Small question regarding SqlServerQuerySqlGenerator
| /// </returns> | ||
| protected override Expression VisitBinary(BinaryExpression binaryExpression) | ||
| { | ||
| if (binaryExpression.Left is SqlFunctionExpression sqlFunctionExpression |
There was a problem hiding this comment.
Could you please look at the issue #11316? Don't you think it's better to add more generic if statement?
Adding some cleanup.