CirrusSearch
Elasticsearch-powered search for MediaWiki
|
A boolean expression. More...
Public Member Functions | |
__construct ( $startOffset, $endOffset, array $children) | |
toArray () | |
getClauses () | |
accept (Visitor $visitor) | |
Public Member Functions inherited from CirrusSearch\Parser\AST\ParsedNode | |
__construct ( $startOffset, $endOffset) | |
getStartOffset () | |
getEndOffset () | |
Additional Inherited Members | |
Protected Member Functions inherited from CirrusSearch\Parser\AST\ParsedNode | |
baseParams () | |
A boolean expression.
This "boolean expression" is suited for matching document in search. It's not really describing a binary tree as one would use to a compute a boolean algebra. It is a flat list of clauses where the clauses are not connected to each others but rather describe how individual clause must occur in a given document:
There is a direct relationship between boolean algebra and this representation:
But it supports describing something that is impossible to describe in a boolean algebra:
In the end this representation makes it possible to support a syntax like: word1 +word2 -word3: [ SHOULD:word1, MUST:word2, MUST_NOT:word3 ] which would not be possible with a binary expression tree
CirrusSearch\Parser\AST\ParsedBooleanNode::__construct | ( | $startOffset, | |
$endOffset, | |||
array | $children ) |
int | $startOffset | |
int | $endOffset | |
BooleanClause[] | $children |
CirrusSearch\Parser\AST\ParsedBooleanNode::accept | ( | Visitor | $visitor | ) |
Visitor | $visitor |
Implements CirrusSearch\Parser\AST\Visitor\Visitable.
CirrusSearch\Parser\AST\ParsedBooleanNode::getClauses | ( | ) |
CirrusSearch\Parser\AST\ParsedBooleanNode::toArray | ( | ) |
Reimplemented from CirrusSearch\Parser\AST\ParsedNode.