Options
All
  • Public
  • Public/Protected
  • All
Menu

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

Hierarchy

  • SearchService

Implements

  • OnDestroy

Index

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
_fullTextFilter: SimpleFilter

Holds the full text Filter if set, undefined otherwise.

_loadingFromMetadata$: LoadingEmitter
_predicateQueryChanged$: Subject<void>

The rootPredicate uses this stream to notify the search service about changes to the held query

_predicateRemoved$: Subject<PredicateRemovalEvent>

The index of a removed Predicate is emmited into this stream

Holds the Predicate tree root for user search queries.

subFilter: Subscription

Accessors

  • get activeFilter$(): Observable<Filter>
  • get additionalFiltersApplied(): boolean
  • get hasVisiblePredicates(): boolean
  • get loadingFromMetadata(): boolean
  • get loadingFromMetadata$(): Observable<boolean>
  • get predicateQueryChanged$(): Observable<Query>

Methods

  • addGeneratedLeafPredicate(generator: Category<any>): number
  • 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

  • addPredicate(newPredicate: Predicate): number
  • Adds a Predicate to the Predicate root and updates the active Filter.

    Predicates added this way will not be visible in the search GUI. If you want to make sure your predicates are visible (and editable) use the [addGeneratedLeafPredicate()]{@link SearchService#addGeneratedLeafPredicate} method instead.

    Parameters

    • newPredicate: Predicate

      Predicate that should be added to the search queries.

    Returns number

    the index of the added Predicate

  • clearFullTextFilter(): void
  • clearPredicates(clearHidden?: boolean): void
  • Replaces the current predicate filter by the one corresponding to the provided generator metadata.

    The CategoryFactory instance must be provided for this service if we want to use this method. Logs an error and does nothing.

    The filterType of this search service must match the filterType of the provided metadata. Otherwise an error is thrown.

    Parameters

    • metadata: FilterMetadata

      the serialized state of the predicate tree that should be restored to this search service

    Returns void

  • ngOnDestroy(): void
  • removePredicate(index: number, clearInput?: boolean): void
  • setFullTextFilter(searchedSubstring: string): void
  • show(predicateIds: number[]): void
  • updateActiveFilter(): void
  • updateWithFullFilter(newFilter: Filter): void

Generated using TypeDoc