Version: 2022.3

QueryEngine

class in UnityEditor.Search

/

继承自:Search.QueryEngine_1

切换到手册

描述

A QueryEngine defines how to build a query from an input string. It can be customized to support custom filters and operators. Default query engine of type object.

构造函数

QueryEngineConstruct a new QueryEngine.

继承的成员

变量

globalStringComparisonGlobal string comparison options for word matching and filter handling (if not overridden).
searchDataCallbackThe callback used to get the data to match to the search words.
searchDataOverridesStringComparisonIndicates if word/phrase matching uses searchDataStringComparison or not.
searchDataStringComparisonString comparison options for word/phrase matching.
searchWordMatcherThe function used to match the search data against the search words.
skipIncompleteFiltersBoolean. Indicates if incomplete filters should be skipped. If true, filters are skipped. If false and validateFilters is true, incomplete filters will generate errors when parsed.
skipUnknownFiltersBoolean. Indicates if unknown filters should be skipped. If true, unknown filters are skipped. If false and validateFilters is true, unknown filters will generate errors if no default filter handler is provided.
validateFiltersGet or set if the engine must validate filters when parsing the query. Defaults to true.

公共函数

AddFilterAdds a new custom filter.
AddFiltersFromAttributeAdds all custom filters that are identified with the method attribute TFilterAttribute.
AddNestedQueryAggregatorAdds a new nested query aggregator. An aggregator is an operation that can be applied on a nested query to aggregate the results of the nested query according to certain criteria.
AddOperatorAdds a custom filter operator.
AddOperatorHandlerAdds a custom filter operator handler.
AddTypeParserAdds a type parser that parses a string and returns a custom type. Used by custom operator handlers (see AddOperatorHandler).
ClearFiltersRemoves all filters that were added on the QueryEngine.
GetAllFiltersGet all filters added on this QueryEngine.
GetOperatorGet a custom operator added on the QueryEngine.
ParseQueryParses a query string into a ParsedQuery operation. This ParsedQuery operation can then be used to filter any data set of type TData.
RemoveFilterRemoves a custom filter.
RemoveOperatorRemoves a custom operator that was added on the QueryEngine.
SetDefaultFilterSets the default filter handler for filters that were not registered.
SetDefaultParamFilterSets the default filter handler for function filters that were not registered.
SetFilterNestedQueryTransformerSets a filter's nested query transformer function. This function takes the result of a nested query and extracts the necessary data to compare with the filter.
SetGlobalStringComparisonOptionsSets global string comparison options. Used for word matching and filter handling (unless overridden by filter).
SetNestedQueryHandlerSets the function that will handle nested queries. Only one handler can be set.
SetSearchDataCallbackSets the callback used to fetch the data that is matched against the search words.
SetSearchWordMatcherSet the search word matching function to be used instead of the default one. Set to null to use the default.
TryGetFilterGet a filter by its token.