Class

Filters

Filters

This class provides utility methods to add filters to search

Methods

all() → {SearchFilter}

Creates a pseudo filter matching all entries.

Other filters will still be applied as expected. This does not override any filtering.

The new search filter.

SearchFilter

and(…filters) → {SearchFilter}

Creates a search filter with the conjunction (and-combination) of the given filters.

Parameters:
Name Type Attributes Description
filters SearchFilter <repeatable>

The filters to combine

The new search filter

SearchFilter

builtinAttributeIn(attributeName, values) → {SearchFilter}

Creates a search filter for a generic search for builtin attributes. Matches any value in the given collection.

If the given attribute does not exist, this filter will return no result.

Parameters:
Name Type Description
attributeName string

The builtin attribute name

values Array.<string>

Allowed values

The new search filter.

SearchFilter

builtinBoolean(attributeName, value) → {SearchFilter}

Creates a search filter for entities which have the builtin boolean attribute with the matching value.

If the given attribute does not exist, this filter will return no result.

Parameters:
Name Type Description
attributeName string

The builtin boolean attribute name

value boolean

Value to restrict the search

The new search filter.

SearchFilter

builtinString(attributeName, value) → {SearchFilter}

Creates a search filter for an exact value of a given builtin string attribute.

If the given attribute does not exist, this filter will return no result.

Parameters:
Name Type Description
attributeName string

The builtin string attribute name

value string

Allowed value

The new search filter.

SearchFilter

builtinTimestamp(attributeName, date) → {SearchFilter}

Creates a search fiter for entities with an exact value for the given builtin attribute.

If the given attribute does not exist, this filter will return no result.

Parameters:
Name Type Description
attributeName string

The builtin attribute name

date Date

Date - value to restrict the search to

The new search filter.

SearchFilter

customAttribute(attributeName) → {FilterBuilder}

Creates a search filter for a custom attribute.

Parameters:
Name Type Description
attributeName string

The name of the attribute

The new search filter.

customAttributeEmpty(attributeName) → {SearchFilter}

Creates a search filter for entities which have no value assigned to the given custom attribute.

Parameters:
Name Type Description
attributeName string

The name of the attribute to filter for

The new search filter.

SearchFilter

customAttributeNonempty(attributeName) → {SearchFilter}

Creates a search filter for entities which have a nonempty value assigned to a given custom attribute.

Parameters:
Name Type Description
attributeName string

The name of the attribute to filter for

The new search filter.

SearchFilter

embeddingSpace() → {SearchFilter}

Creates a search filter to match entities within the space of the entity embedding the search. If there is no such space, the filter is ignored.

See:
  • Search.setEmbeddingEntity()

The new search filter.

SearchFilter

none() → {SearchFilter}

Creates a pseudo filter matching no entry.

This filter will always reduce the result of a search to none, disregarding any other filter.

The new search filter.

SearchFilter

not(filter) → {SearchFilter}

Creates a search filter with the negation/inversion of the given filter.

Parameters:
Name Type Description
filter SearchFilter

The filter to invert

The new search filter.

SearchFilter

or(…filters) → {SearchFilter}

Creates a search filter with the disjunction (or-combination) of the given filters.

Parameters:
Name Type Attributes Description
filters SearchFilter <repeatable>

The filters to combine

The new search filter.

SearchFilter

space(spaceId) → {SearchFilter}

Creates a search filter to match entities within a given space.

Parameters:
Name Type Description
spaceId string

The id of the space to restrict the search to

The new search filter.

SearchFilter

spaces(spaceIds) → {SearchFilter}

Creates a search fiter to match entities within a list of spaces.

Parameters:
Name Type Description
spaceIds Array.<string>

The ids of the spaces to restrict the search to

The new search filter.

SearchFilter

text(text) → {SearchFilter}

Creates a search filter for entities containing the given text.

The text may be contained in any field of the entity.

Parameters:
Name Type Description
text string

The text to be contained in the entity

The new search filter.

SearchFilter

type(typeName) → {SearchFilter}

Creates a search filters restricting the search to one or more types.

Parameters:
Name Type Description
typeName string | Array.<string>

Name of the type or an array of type names

The new search filter.

SearchFilter

uid(uid) → {SearchFilter}

Creates a search filter for the entity with the given Uid.

Parameters:
Name Type Description
uid string

The Uid of the entity to search for

The new search filter.

SearchFilter

uids(uids) → {SearchFilter}

Creates a search filter for entities with the given Uids.

Parameters:
Name Type Description
uids Array.<string>

The Uids of the entities to search for

The new search filter.

SearchFilter