Functions
abs()
Returns
LogicalExpression
all()
expr is true.
Parameters
Returns
LogicalExpression
any()
expr is true.
Parameters
Returns
LogicalExpression
field()
Returns
LogicalExpression
filter()
Returns
Query
groupBy()
Returns
Query
literal()
Returns
LogicalExpression
match()
token argument is a raw query string — TopK tokenizes it automatically,
removes stop words, and scores documents using BM25. Pass the full query string
directly; tokenization and stop-word removal happen server-side.
options.field: restrict matching to a specific keyword-indexed field (default: all).options.weight: scale the BM25 contribution of this expression (default: 1.0).options.all: if true, require all tokens to match (AND); default is any-token (OR).
Returns
TextExpression
matchTokens()
MatchTokenInput object.
Parameters
Returns
TextExpression
max()
Returns
LogicalExpression
min()
Returns
LogicalExpression
not()
Returns
LogicalExpression
select()
Returns
Query
should()
should() together with
match() when some terms are required and others should only influence ranking.
When used on its own, should() matches the entire collection and ranks
documents according to how well they match the term.
hobbit or rings, while boosting
documents that also match lord.
options.field: Keyword-indexed field used for scoring. Searches all eligible fields when omitted.options.weight: Multiplier applied to the term’s BM25 contribution. Defaults to1.0.
Returns
TextExpression
Classes
AggregateExpression
Internal
FunctionExpression
Internal
Methods
abs()
LogicalExpression
add()
Returns
LogicalExpression
boost()
Returns
LogicalExpression
choose()
Returns
LogicalExpression
coalesce()
Returns
LogicalExpression
div()
Returns
LogicalExpression
eq()
Returns
LogicalExpression
exp()
LogicalExpression
gt()
Returns
LogicalExpression
gte()
Returns
LogicalExpression
isNotNull()
LogicalExpression
isNull()
LogicalExpression
ln()
LogicalExpression
lt()
Returns
LogicalExpression
lte()
Returns
LogicalExpression
max()
Returns
LogicalExpression
min()
Returns
LogicalExpression
mul()
Returns
LogicalExpression
ne()
Returns
LogicalExpression
sqrt()
LogicalExpression
square()
LogicalExpression
sub()
Returns
LogicalExpression
LogicalExpression
Internal
Methods
abs()
LogicalExpression
add()
Returns
LogicalExpression
and()
Returns
LogicalExpression
boost()
boost value if the condition is true.
Otherwise, the scoring expression is unchanged (multiplied by 1).
Parameters
Returns
LogicalExpression
choose()
Returns
LogicalExpression
coalesce()
Returns
LogicalExpression
contains()
Returns
LogicalExpression
datePart()
"year"— calendar year"month"— 1-12"week"— ISO week number"day"— day of month, 1-31"day_of_year"— 1-366"day_of_week"— 0-6, Monday = 0"hour"— 0-23"minute"— 0-59"second"— 0-59"millisecond"— 0-999
Returns
LogicalExpression
div()
Returns
LogicalExpression
elapsed()
interval units elapsed between the expression and end.
Parameters
Returns
LogicalExpression
eq()
Returns
LogicalExpression
exp()
LogicalExpression
gt()
Returns
LogicalExpression
gte()
Returns
LogicalExpression
in()
Returns
LogicalExpression
isNotNull()
LogicalExpression
isNull()
LogicalExpression
ln()
LogicalExpression
lt()
Returns
LogicalExpression
lte()
Returns
LogicalExpression
matchAll()
Returns
LogicalExpression
matchAny()
Returns
LogicalExpression
max()
Returns
LogicalExpression
min()
Returns
LogicalExpression
mul()
Returns
LogicalExpression
ne()
Returns
LogicalExpression
or()
Returns
LogicalExpression
regexpMatch()
Returns
LogicalExpression
sqrt()
LogicalExpression
square()
LogicalExpression
startsWith()
Returns
LogicalExpression
sub()
Returns
LogicalExpression
toString()
string
Query
Internal
A query object that represents a sequence of query stages.
Queries are built by chaining together different stages like select, filter, topk, etc.
Each stage performs a specific operation on the data.
Methods
count()
Query
filter()
Returns
Query
groupBy()
Returns
Query
limit()
Returns
Query
offset()
Returns
Query
select()
Returns
Query
sort()
Call Signature
Returns
Query
Call Signature
Returns
Query
topk()
Returns
Query
Deprecated
Use.sort(expr, false).limit(k) instead.
TextExpression
Constructors ConstructorTextExpression
Methods
and()
Returns
TextExpression
or()
Returns
TextExpression
Interfaces
MatchOptions
Options for text matching. This struct contains configuration options for text matching operations, including field specification, weight, and matching behavior. PropertiesMatchTokenInput
A token for match_tokens PropertiesMatchTokensOptions
Options for match_tokens. PropertiesShouldOptions
Options forshould scoring.
Properties