Search predicates module containing text and token matching predicates.

Classes

Functions

fuzzy

(String query, Number distance)

Supports fuzzy searches based on the Levenshtein Distance, or Edit Distance algorithm (case sensitive).

Example: the search expression is fuzzy("david", 1)

  • the inserted value “david” is found
  • the inserted value “dawid” is found
  • the inserted value “davids” is found
  • the inserted value “dewid” is not found
Parameters:
Name Type Description
query String

the string to look for in the value

distance Number

the number of “uncertainties” allowed for the Leveinshtein algorithm.

Returns:
Type Description
TextDistanceP

phrase

(String query, Number distance)

Supports finding words which are a within a specific distance away (case insensitive).

Example: the search expression is phrase("Hello world", 2)

  • the inserted value “Hello world” is found
  • the inserted value “Hello wild world” is found
  • the inserted value “Hello big wild world” is found
  • the inserted value “Hello the big wild world” is not found
  • the inserted value “Goodbye world” is not found.
Parameters:
Name Type Description
query String

the string to look for in the value

distance Number

the number of terms allowed between two correct terms to find a value.

Returns:
Type Description
TextDistanceP

prefix

(value)

Search for a specific prefix at the beginning of the text property targeted.

Parameters:
Name Type Description
value

The value to look for.

Returns:
Type Description
P

regex

(value)

Search for this regular expression inside the text property targeted.

Parameters:
Name Type Description
value

The regular expression.

Returns:
Type Description
P

token

(value)

Search any instance of a certain token within the text property targeted.

Parameters:
Name Type Description
value

The value to look for.

Returns:
Type Description
P

tokenFuzzy

(String query, Number distance)

Supports fuzzy searches based on the Levenshtein Distance, or Edit Distance algorithm after having tokenized the data stored (case insensitive).

Example: the search expression is tokenFuzzy(“david”, 1)

  • the inserted value “david” is found
  • the inserted value “dawid” is found
  • the inserted value “hello-dawid” is found
  • the inserted value “dewid” is not found
Parameters:
Name Type Description
query String

the string to look for in the value

distance Number

the number of “uncertainties” allowed for the Leveinshtein algorithm.

Returns:
Type Description
TextDistanceP

tokenPrefix

(value)

Search any instance of a certain token prefix withing the text property targeted.

Parameters:
Name Type Description
value

The value to look for.

Returns:
Type Description
P

tokenRegex

(value)

Search any instance of the provided regular expression for the targeted property.

Parameters:
Name Type Description
value

The value to look for.

Returns:
Type Description
P