CirrusSearch
Elasticsearch-powered search for MediaWiki
|
Inspect a query and determine what parts of it can be sent to a typo correction mechanism and provide a method to fix the query once the corrected substring is known. More...
Public Member Functions | |
__construct (ParsedQuery $query) | |
getFixablePart () | |
Get the longest phrase that is subject to typo correction. | |
fix ( $replacement) | |
Replace the fixable part of the visited query with the provided replacement. | |
visitWordsQueryNode (WordsQueryNode $node) | |
visitPhraseQueryNode (PhraseQueryNode $node) | |
visitPhrasePrefixNode (PhrasePrefixNode $node) | |
visitFuzzyNode (FuzzyNode $node) | |
visitPrefixNode (PrefixNode $node) | |
visitWildcardNode (WildcardNode $node) | |
visitEmptyQueryNode (EmptyQueryNode $node) | |
visitKeywordFeatureNode (KeywordFeatureNode $node) | |
visitParsedBooleanNode (ParsedBooleanNode $node) | |
visitBooleanClause (BooleanClause $clause) | |
visitNegatedNode (NegatedNode $node) | |
visitNamespaceHeader (NamespaceHeaderNode $node) | |
Static Public Member Functions | |
static | build (ParsedQuery $query) |
Inspect a query and determine what parts of it can be sent to a typo correction mechanism and provide a method to fix the query once the corrected substring is known.
CirrusSearch\Parser\AST\Visitor\QueryFixer::__construct | ( | ParsedQuery | $query | ) |
ParsedQuery | $query |
|
static |
ParsedQuery | $query |
CirrusSearch\Parser\AST\Visitor\QueryFixer::fix | ( | $replacement | ) |
Replace the fixable part of the visited query with the provided replacement.
HtmlArmor | string | $replacement | If HtmlArmor is provided all modifications will be html safe and HtmlArmor will be returned. If a string is provided no escaping will occur. |
CirrusSearch\Parser\AST\Visitor\QueryFixer::getFixablePart | ( | ) |
Get the longest phrase that is subject to typo correction.
It's generally a set of consecutive words.
@phan-suppress-next-line PhanImpossibleCondition I agree, this is impossible.
CirrusSearch\Parser\AST\Visitor\QueryFixer::visitBooleanClause | ( | BooleanClause | $clause | ) |
BooleanClause | $clause |
Implements CirrusSearch\Parser\AST\Visitor\Visitor.
CirrusSearch\Parser\AST\Visitor\QueryFixer::visitEmptyQueryNode | ( | EmptyQueryNode | $node | ) |
EmptyQueryNode | $node |
Implements CirrusSearch\Parser\AST\Visitor\Visitor.
CirrusSearch\Parser\AST\Visitor\QueryFixer::visitFuzzyNode | ( | FuzzyNode | $node | ) |
FuzzyNode | $node |
Implements CirrusSearch\Parser\AST\Visitor\Visitor.
CirrusSearch\Parser\AST\Visitor\QueryFixer::visitKeywordFeatureNode | ( | KeywordFeatureNode | $node | ) |
KeywordFeatureNode | $node |
Implements CirrusSearch\Parser\AST\Visitor\Visitor.
|
final |
NamespaceHeaderNode | $node |
@phan-suppress-next-line PhanImpossibleCondition I agree, this is impossible.
Implements CirrusSearch\Parser\AST\Visitor\Visitor.
|
final |
NegatedNode | $node |
@phan-suppress-next-line PhanImpossibleCondition I agree, this is impossible.
Implements CirrusSearch\Parser\AST\Visitor\Visitor.
CirrusSearch\Parser\AST\Visitor\QueryFixer::visitParsedBooleanNode | ( | ParsedBooleanNode | $node | ) |
ParsedBooleanNode | $node |
Implements CirrusSearch\Parser\AST\Visitor\Visitor.
CirrusSearch\Parser\AST\Visitor\QueryFixer::visitPhrasePrefixNode | ( | PhrasePrefixNode | $node | ) |
PhrasePrefixNode | $node |
Implements CirrusSearch\Parser\AST\Visitor\Visitor.
CirrusSearch\Parser\AST\Visitor\QueryFixer::visitPhraseQueryNode | ( | PhraseQueryNode | $node | ) |
PhraseQueryNode | $node |
Implements CirrusSearch\Parser\AST\Visitor\Visitor.
CirrusSearch\Parser\AST\Visitor\QueryFixer::visitPrefixNode | ( | PrefixNode | $node | ) |
PrefixNode | $node |
Implements CirrusSearch\Parser\AST\Visitor\Visitor.
CirrusSearch\Parser\AST\Visitor\QueryFixer::visitWildcardNode | ( | WildcardNode | $node | ) |
WildcardNode | $node |
Implements CirrusSearch\Parser\AST\Visitor\Visitor.
CirrusSearch\Parser\AST\Visitor\QueryFixer::visitWordsQueryNode | ( | WordsQueryNode | $node | ) |
WordsQueryNode | $node |
Implements CirrusSearch\Parser\AST\Visitor\Visitor.