Version: 2023.1
언어: 한국어
public Search.QueryFilterOperator AddOperator (string op);

파라미터

op The operator identifier.

반환

QueryFilterOperator The added, or existing, QueryFilterOperator.

설명

Add a custom filter operator specific to the filter.

Custom operators defined on a filter take precedence over operators defined globally on the QueryEngine. This is useful if you wish to have a custom operator only for a specific filter, or if you wish to override the default behavior of a built-in operator for a specific filter. If the operator already exists, the existing operator is returned.

// Override global operators with specific operator handlers for this filter
filter.AddOperator("=").AddHandler((Vector2 ev, Vector2 fv) => ev == fv);
filter.AddOperator("!=").AddHandler((Vector2 ev, Vector2 fv) => ev != fv);

See IQueryEngineFilter for a complete example.