Holds information about the filter that is currently applied to the view component, that provides this services.

Implements

  • OnDestroy

Constructors

Properties

_activeFilter: BehaviorSubject<Filter>

Holds the Filter that is currently being applied to the view.

_baseFilter: Filter

Filter that is applied to the view, even if the user doesn't search anything.

_categoryFactory: CategoryFactory

a CategoryFactory instance. This dependency is optional. It is required if we want to load predicate filter from saved metadata

_fullTextFilter: SimpleFilter

Holds the full text Filter if set, undefined otherwise.

_ignoreNetsOnAutocompleteCategories: boolean

boolean flag that determines whether net-related categories should be ignored when providing autocomplete suggestions. Injected through the NAE_IGNORE_NETS_ON_AUTOCOMPLETE_CATEGORY injection token.

_loadingFromPfql$: LoadingEmitter
_predicateRemoved$: Subject<PredicateRemovalEvent>

The index of a removed Predicate is emmited into this stream

Holds the Predicate tree root for user search queries.

_visitor: PfqlVisitor

service to parse query tree into QueryItems

Accessors

Methods

  • Adds a new hidden branch of the predicate tree with a singular leaf node containing the provided Query.

    This can be used to add predicates to the search tree (think header search), which can be made visible and editable in the search GUI later.

    Parameters

    • generator: Category<any>

      the generator that is in such state, that it generates the Query, that should be added as branch/leaf. If the generator doesn't currently generate a query a node with an empty query will be added.

    Returns number

  • Loads a PFQL query string into the search service's predicate tree structure.

    Parses the provided PFQL query and reconstructs the predicate tree from it. The query resource type must match the filter type of this search service. All existing predicates (including hidden ones) are cleared before loading the new query.

    Parameters

    • query: string

      the PFQL query string to parse and load into the predicate tree

    Returns void

  • Loads a raw PFQL expression into a predicate node.

    Creates a new clause predicate branch, extracts the plain query category from the raw expression, loads the expression data into the category, and adds the category as a new predicate generator to the created branch.

    Parameters

    Returns Observable<void>

    an observable that emits when the category data has been loaded from the expression

  • Loads a simple PFQL expression into a predicate node.

    Extracts the category from the simple expression, loads the expression data into the category, and adds the category as a new predicate generator to the given predicate node.

    Parameters

    Returns Observable<void>

    an observable that emits when the category data has been loaded from the expression

  • Removes the Predicate object from the provided index. If the index is invalid does nothing. Updates the the active Filter if the Predicate tree was affected.

    Parameters

    • index: number

      index of the Predicate that should be removed

    • clearInput: boolean = true

      whether the input, that corresponds to the predicate should be cleared

    Returns void