internal package
Foswiki::Query::Node is a
Foswiki::Infix::Node evaluate
method as its general
contract with the rest of the world. This method is a "reference implementation" -
it does a brute force evaluation of the expression represented by the node in a given
data domain. It is expected that smarter store implementations will analyse the parse tree
and derive as many optimisations as possible, minimising fallback to this brute force
evaluation.
The reference implementation of evaluation uses the getField
method in the
{Store}{QueryAlgorithm} to get data from the store. This further decouples the query
object from the detail of the store implementation.
See Foswiki::Store::QueryAlgorithms for a full spec of the interface to
query algorithms.
ObjectMethod
evaluate(...) → $result evaluate
method of the attached operator.
The return result is either an array ref (for many results) or a scalar (for a
single result)
This is the reference evaluator for queries. However it may not be the only
engine that evaluates them; external engines, such as SQL, might be delegated
the responsibility of evaluating queries in a search context.
Name resolution depends on the context in which the name is used. A name
on the LHS of the dot and where operators may only be a form name, or a META:
name, referred to as a "restricted name". A name anywhere else can be
a META: name, a field name, or one of the shortcuts (such as "web", "name"
etc). Fields and forms are looked up by calling the getField
and
getForm
methods in the query engine respectively.
ObjectMethod
evaluatesToConstant(%opts) ObjectMethod
simplify(%opts) ObjectMethod
tokens() → [] ObjectMethod
isEmpty() → $boolean ![]() |
© 2025 D.Soost & D.Marxsen - All rights reserved © Of all articles by authors Trademarks are the property of their respective owners © Logo by Wikipedia, modified by Administrator | Impressum Disclaimer Datenschutzerklärung |