Skip to content

DbFullTextSearchOptions class

Contains options for the model-based full-text search (see Korzh.EasyQuery.QueryFullTextSearchExtensions.AddFullTextSearchConditions(Korzh.EasyQuery.Query,System.String,Korzh.EasyQuery.DbFullTextSearchOptions)).

public class Korzh.EasyQuery.DbFullTextSearchOptions

Package: Korzh.EasyQuery (targets: netstandard2.0)

Assembly: Korzh.EasyQuery.dll

NameTypeDescription
DbFullTextSearchOptions()void
NameTypeDescription
EntitiesIList<string>Gets or sets the default list of the entities (by their names) to search in. If this list is empty - all entities of the model will be processed. This list is used only when the search scope cannot be taken from the query itself, i.e. when the query has neither columns nor conditions (the data filtering scenario). See Korzh.EasyQuery.QueryFullTextSearchExtensions.AddFullTextSearchConditions(Korzh.EasyQuery.Query,System.String,Korzh.EasyQuery.DbFullTextSearchOptions) for the description of the search scope. Note: it can contain the names of the sub-entities only. The attributes of the root entity are managed by Korzh.EasyQuery.DbFullTextSearchOptions.IncludeRootEntity property.
IgnoreCaseboolIf set to true (the default value) - the text attributes are searched regardless of the letter case: both the attribute’s value and the search term are compared in lower case (via the “ContainsIgnoreCase” operator, see Korzh.EasyQuery.DataModel.AddUpdateContainsIgnoreCaseOperator). Otherwise, the regular “Contains” operator is used, and whether it’s case-sensitive depends on the database (e.g. on the column’s collation in SQL Server; PostgreSQL and SQLite compare case-sensitively). The lower-casing is done by the database, so it’s as good as the database’s LOWER function (SQLite’s one, for example, folds the ASCII letters only). The date/time and numeric attributes (see Korzh.EasyQuery.DbFullTextSearchOptions.IncludeDateTimeFields and Korzh.EasyQuery.DbFullTextSearchOptions.IncludeNumericFields) are not affected: they are matched by their string representation as is.
IncludeDateTimeFieldsboolIf set to true - the date/time attributes are included into the search as well. Their values are converted to their string representations before the comparison, so the search text is matched against the textual form of the date (e.g. “2018-09”). The way of the conversion depends on the type of the database. For SQL queries it’s defined by the “CastToString” function in SqlFormats.SqlFunctions.
IncludeNumericFieldsboolIf set to true - the numeric attributes (integers, floats, currency) are included into the search as well. Their values are converted to their string representations before the comparison, so the search text is matched against the textual form of the number (e.g. “10248” or “22.98”). The way of the conversion depends on the type of the database. For SQL queries it’s defined by the “CastToString” function in SqlFormats.SqlFunctions. Note that the exact string representation of a number is up to the database: the number of decimal places, the decimal separator and the scientific notation for the floating-point values may differ from what the end-user sees in the result grid. The numeric attributes are searched only for those search terms which contain at least one digit. A term like “London” cannot match the string representation of a number, so there is no point in adding a cast-to-text comparison for it to the query.
IncludeRootEntityboolIf set to true (the default value) - the attributes of the root entity are processed as well. Like Korzh.EasyQuery.DbFullTextSearchOptions.Entities, it takes effect only when the query has neither columns nor conditions. The root entity is not a part of Korzh.EasyQuery.DbFullTextSearchOptions.Entities list since it has no name. For the models built over one main entity (e.g. by UseEntity<Order>()) the attributes of that entity are exactly the attributes of the root one.
IsDescendingOrderboolIf set to true then we use descending order.
OrderBystringThe ID of the entity attribute to order the result list by.
UseExtraConditionsboolIf set to true (the default value) - the search conditions are added to the Korzh.EasyQuery.Query.ExtraConditions group (invisible for end-users but included into the result SQL). Otherwise, the conditions are added to the Korzh.EasyQuery.Query.Root group.